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

Public Member Functions

Pop< T > (string id)
 
PopfabItem Pop (string id, string text=null)
 
PopfabItem Pop (PopfabItem item)
 
void Remove (PopfabItem item)
 
void Clear ()
 
void ForceOutro ()
 
void PushItems (Vector3 pos)
 

Public Attributes

float fixX
 
float fixY
 
float spacing = 10f
 
bool invert
 
int maxItems
 
Ease pushEase = Ease.Linear
 
float pushDuration = 0.5f
 
List< PopfabItemlist = new List<PopfabItem>()
 

Protected Member Functions

virtual void Awake ()
 

Private Member Functions

void OnDestroy ()
 

Private Attributes

Transform _trans
 

Detailed Description

Definition at line 5 of file Popfab.cs.

Member Function Documentation

◆ Awake()

virtual void Popfab.Awake ( )
inlineprotectedvirtual

Definition at line 26 of file Popfab.cs.

27 {
28 _trans = base.transform;
29 }
Transform _trans
Definition: Popfab.cs:21

References _trans.

◆ Clear()

void Popfab.Clear ( )
inline

Definition at line 75 of file Popfab.cs.

76 {
77 for (int num = list.Count - 1; num >= 0; num--)
78 {
79 list[num].Kill();
80 }
81 }
List< PopfabItem > list
Definition: Popfab.cs:24

References list.

◆ ForceOutro()

void Popfab.ForceOutro ( )
inline

Definition at line 83 of file Popfab.cs.

84 {
85 foreach (PopfabItem item in list)
86 {
87 item.ForceOutro();
88 }
89 }

References item, and list.

◆ OnDestroy()

void Popfab.OnDestroy ( )
inlineprivate

Definition at line 104 of file Popfab.cs.

105 {
106 for (int num = base.transform.childCount - 1; num >= 0; num--)
107 {
108 _trans.GetChild(num).GetComponent<PopfabItem>().Kill();
109 }
110 }

References _trans.

◆ Pop() [1/2]

PopfabItem Popfab.Pop ( PopfabItem  item)
inline

Definition at line 43 of file Popfab.cs.

44 {
45 item.Init(_trans);
46 if (maxItems > 0)
47 {
48 item.isUseDuration = false;
49 }
50 if (pushEase != 0 && list.Count > 0)
51 {
52 PushItems(new Vector3(0f, item.rect.sizeDelta.y + spacing, 0f));
53 }
54 list.Add(item);
55 item.reciever = this;
56 if (maxItems != 0 && list.Count >= maxItems)
57 {
58 for (int i = 0; i < list.Count - maxItems; i++)
59 {
60 if (!list[i].isOutro)
61 {
62 list[i].Outro();
63 }
64 }
65 }
66 item.Intro();
67 return item;
68 }
void PushItems(Vector3 pos)
Definition: Popfab.cs:91
int maxItems
Definition: Popfab.cs:15
Ease pushEase
Definition: Popfab.cs:17
float spacing
Definition: Popfab.cs:11

References _trans, item, list, maxItems, pushEase, PushItems(), and spacing.

◆ Pop() [2/2]

PopfabItem Popfab.Pop ( string  id,
string  text = null 
)
inline

Definition at line 36 of file Popfab.cs.

37 {
38 PopfabItem popfabItem = ResourceCache.Load<PopfabItem>("UI/Pop/" + id);
39 popfabItem.Set(text);
40 return Pop(popfabItem);
41 }
void Set(string text)
Definition: PopfabItem.cs:83
PopfabItem Pop(string id, string text=null)
Definition: Popfab.cs:36

References Pop(), and PopfabItem.Set().

Referenced by Pop().

◆ Pop< T >()

T Popfab.Pop< T > ( string  id)
inline
Type Constraints
T :PopfabItem 

Definition at line 31 of file Popfab.cs.

32 {
33 return Util.Instantiate(ResourceCache.Load<T>("UI/Pop/" + id), this);
34 }
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References Util.

◆ PushItems()

void Popfab.PushItems ( Vector3  pos)
inline

Definition at line 91 of file Popfab.cs.

92 {
93 if (invert)
94 {
95 pos *= -1f;
96 }
97 foreach (PopfabItem item in list)
98 {
99 item.destY += pos.y;
100 item.rect.DOLocalMoveY(item.destY, pushDuration).SetEase(pushEase);
101 }
102 }
bool invert
Definition: Popfab.cs:13
float pushDuration
Definition: Popfab.cs:19

References invert, item, list, pushDuration, and pushEase.

Referenced by Pop().

◆ Remove()

void Popfab.Remove ( PopfabItem  item)
inline

Definition at line 70 of file Popfab.cs.

71 {
72 list.Remove(item);
73 }

References item, and list.

Referenced by PopfabItem.Kill().

Member Data Documentation

◆ _trans

Transform Popfab._trans
private

Definition at line 21 of file Popfab.cs.

Referenced by Awake(), OnDestroy(), and Pop().

◆ fixX

float Popfab.fixX

Definition at line 7 of file Popfab.cs.

◆ fixY

float Popfab.fixY

Definition at line 9 of file Popfab.cs.

◆ invert

bool Popfab.invert

Definition at line 13 of file Popfab.cs.

Referenced by PushItems().

◆ list

List<PopfabItem> Popfab.list = new List<PopfabItem>()

Definition at line 24 of file Popfab.cs.

Referenced by Clear(), ForceOutro(), Pop(), PushItems(), and Remove().

◆ maxItems

int Popfab.maxItems

Definition at line 15 of file Popfab.cs.

Referenced by Pop().

◆ pushDuration

float Popfab.pushDuration = 0.5f

Definition at line 19 of file Popfab.cs.

Referenced by PushItems().

◆ pushEase

Ease Popfab.pushEase = Ease.Linear

Definition at line 17 of file Popfab.cs.

Referenced by Pop(), and PushItems().

◆ spacing

float Popfab.spacing = 10f

Definition at line 11 of file Popfab.cs.

Referenced by Pop().


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