Elin Decompiled Documentation
EA 23.300 Nightly
Loading...
Searching...
No Matches
UIItemPCCPart.cs
Go to the documentation of this file.
1
using
System;
2
using
UnityEngine;
3
using
UnityEngine.UI;
4
5
public
class
UIItemPCCPart
:
EMono
6
{
7
public
ButtonGeneral
button
;
8
9
public
Outline
outline
;
10
11
[NonSerialized]
12
public
Sprite[]
sprites
=
new
Sprite[16];
13
14
private
bool
_init
;
15
16
public
void
SetSpriteIndex
(
int
dir,
int
frame)
17
{
18
if
(
_init
)
19
{
20
button.icon.sprite =
sprites
[dir * 4 + frame];
21
}
22
}
23
24
public
void
SetSprites
(Texture2D texture)
25
{
26
int
num = texture.width / 4;
27
int
num2 = texture.height / 4;
28
for
(
int
i = 0; i < 4; i++)
29
{
30
for
(
int
j = 0; j < 4; j++)
31
{
32
int
num3 = j * num;
33
int
num4 = (3 - i) * num2;
34
Rect rect =
new
Rect(num3, num4, num, num2);
35
sprites
[i * 4 + j] = Sprite.Create(texture, rect,
new
Vector2(0.5f, 0.5f), 100f, 0u, SpriteMeshType.FullRect);
36
}
37
}
38
_init
=
true
;
39
}
40
}
HitResult.Outline
@ Outline
ButtonGeneral
Definition:
ButtonGeneral.cs:4
EMono
Definition:
EMono.cs:4
UIItemPCCPart
Definition:
UIItemPCCPart.cs:6
UIItemPCCPart.button
ButtonGeneral button
Definition:
UIItemPCCPart.cs:7
UIItemPCCPart.SetSprites
void SetSprites(Texture2D texture)
Definition:
UIItemPCCPart.cs:24
UIItemPCCPart.outline
Outline outline
Definition:
UIItemPCCPart.cs:9
UIItemPCCPart._init
bool _init
Definition:
UIItemPCCPart.cs:14
UIItemPCCPart.sprites
Sprite[] sprites
Definition:
UIItemPCCPart.cs:12
UIItemPCCPart.SetSpriteIndex
void SetSpriteIndex(int dir, int frame)
Definition:
UIItemPCCPart.cs:16
Elin
UIItemPCCPart.cs
Generated by
1.9.6