Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
UIFollow.cs
Go to the documentation of this file.
1
using
System;
2
using
UnityEngine;
3
4
public
class
UIFollow
: MonoBehaviour
5
{
6
public
Transform
target
;
7
8
public
Vector3
fixPos
;
9
10
public
bool
followPos
;
11
12
public
Func<bool>
endCondition
;
13
14
public
void
SetTarget
(Transform _trans)
15
{
16
target
= _trans;
17
}
18
19
public
void
LateUpdate
()
20
{
21
if
(
followPos
)
22
{
23
GameObject go = base.gameObject;
24
BaseCore
.
Instance
.
actionsLateUpdate
.Add(delegate
25
{
26
if
(go !=
null
)
27
{
28
base.transform.Rect().anchoredPosition = Camera.main.WorldToScreenPoint(
fixPos
) /
BaseCore
.
Instance
.
uiScale
;
29
}
30
});
31
}
32
else
if
(!
target
|| !
target
.gameObject.activeSelf || (
endCondition
!=
null
&&
endCondition
()))
33
{
34
UnityEngine.Object.DestroyImmediate(base.gameObject);
35
}
36
else
37
{
38
base.transform.position = target.position +
fixPos
;
39
}
40
}
41
}
BaseCore
Definition:
BaseCore.cs:8
BaseCore.uiScale
virtual float uiScale
Definition:
BaseCore.cs:46
BaseCore.Instance
static BaseCore Instance
Definition:
BaseCore.cs:11
BaseCore.actionsLateUpdate
List< Action > actionsLateUpdate
Definition:
BaseCore.cs:29
UIFollow
Definition:
UIFollow.cs:5
UIFollow.followPos
bool followPos
Definition:
UIFollow.cs:10
UIFollow.SetTarget
void SetTarget(Transform _trans)
Definition:
UIFollow.cs:14
UIFollow.LateUpdate
void LateUpdate()
Definition:
UIFollow.cs:19
UIFollow.fixPos
Vector3 fixPos
Definition:
UIFollow.cs:8
UIFollow.target
Transform target
Definition:
UIFollow.cs:6
UIFollow.endCondition
Func< bool > endCondition
Definition:
UIFollow.cs:12
Elin
Plugins.UI
UIFollow.cs
Generated by
1.9.6