Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
MsgLine Class Reference
Inheritance diagram for MsgLine:

Public Member Functions

void Append (string s, FontColor col)
 
void Append (Sprite s, bool fitLine=true)
 
void Reset ()
 

Public Attributes

HorizontalLayoutGroup layout
 
RectTransform rect
 
MsgBlock block
 

Properties

MsgBox.Prefabs prefabs [get]
 

Private Member Functions

void Awake ()
 
void AddElement (Component c)
 
void AddElement (Component c, MsgLine line)
 

Detailed Description

Definition at line 5 of file MsgLine.cs.

Member Function Documentation

◆ AddElement() [1/2]

void MsgLine.AddElement ( Component  c)
inlineprivate

Definition at line 43 of file MsgLine.cs.

44 {
45 if (rect.sizeDelta.x > block.box.maxWidth / 3f)
46 {
47 _ = rect.sizeDelta.x + c.Rect().sizeDelta.x;
48 _ = block.box.maxWidth;
49 }
50 }
MsgBox box
Definition: MsgBlock.cs:22
float maxWidth
Definition: MsgBox.cs:66
RectTransform rect
Definition: MsgLine.cs:9
MsgBlock block
Definition: MsgLine.cs:12

References block, MsgBlock.box, MsgBox.maxWidth, and rect.

Referenced by Append().

◆ AddElement() [2/2]

void MsgLine.AddElement ( Component  c,
MsgLine  line 
)
inlineprivate

Definition at line 52 of file MsgLine.cs.

53 {
54 c.transform.SetParent(line.transform, worldPositionStays: false);
55 line.layout.RebuildLayout();
56 }
HorizontalLayoutGroup layout
Definition: MsgLine.cs:7

References layout.

◆ Append() [1/2]

void MsgLine.Append ( Sprite  s,
bool  fitLine = true 
)
inline

Definition at line 29 of file MsgLine.cs.

30 {
31 Transform transform = PoolManager.Spawn(prefabs.image, layout);
32 Image componentInChildren = transform.GetComponentInChildren<Image>();
33 componentInChildren.sprite = s;
34 if (fitLine)
35 {
36 RectTransform rectTransform = transform.Rect();
37 rectTransform.sizeDelta = new Vector2(rect.sizeDelta.y, rect.sizeDelta.y);
38 componentInChildren.transform.Rect().sizeDelta = rectTransform.sizeDelta;
39 }
40 AddElement(transform);
41 }
void AddElement(Component c)
Definition: MsgLine.cs:43
MsgBox.Prefabs prefabs
Definition: MsgLine.cs:14
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86

References AddElement(), layout, prefabs, rect, and PoolManager.Spawn().

◆ Append() [2/2]

void MsgLine.Append ( string  s,
FontColor  col 
)
inline

Definition at line 21 of file MsgLine.cs.

22 {
23 UIText uIText = PoolManager.Spawn(prefabs.text, layout);
24 uIText.SetText(s, col);
25 uIText.RebuildLayout();
26 AddElement(uIText);
27 }
Definition: UIText.cs:6
void SetText(string s)
Definition: UIText.cs:159

References AddElement(), layout, prefabs, UIText.SetText(), and PoolManager.Spawn().

◆ Awake()

void MsgLine.Awake ( )
inlineprivate

Definition at line 16 of file MsgLine.cs.

17 {
18 rect = this.Rect();
19 }

References rect.

◆ Reset()

void MsgLine.Reset ( )
inline

Definition at line 58 of file MsgLine.cs.

59 {
60 for (int num = base.transform.childCount - 1; num >= 0; num--)
61 {
62 PoolManager.DespawnOrDestroy(base.transform.GetChild(num));
63 }
64 this.RebuildLayout();
65 }
static void DespawnOrDestroy(Component c)
Definition: PoolManager.cs:158

References PoolManager.DespawnOrDestroy().

Member Data Documentation

◆ block

MsgBlock MsgLine.block

Definition at line 12 of file MsgLine.cs.

Referenced by AddElement().

◆ layout

HorizontalLayoutGroup MsgLine.layout

Definition at line 7 of file MsgLine.cs.

Referenced by AddElement(), and Append().

◆ rect

RectTransform MsgLine.rect

Definition at line 9 of file MsgLine.cs.

Referenced by AddElement(), Append(), and Awake().

Property Documentation

◆ prefabs

MsgBox.Prefabs MsgLine.prefabs
get

Definition at line 14 of file MsgLine.cs.

Referenced by Append().


The documentation for this class was generated from the following file: