Elin Modding Docs Doc
Loading...
Searching...
No Matches
TCOrbitThing.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000180 RID: 384
5public class TCOrbitThing : TCOrbit
6{
7 // Token: 0x06000B12 RID: 2834 RVA: 0x000450D0 File Offset: 0x000432D0
8 public override void OnSetOwner()
9 {
10 this.owner = (base.owner as Thing);
11 RenderData data = this.owner.renderer.data;
12 this.goIcon.transform.SetLocalPositionY(data.offset.y + data.size.y + 0.32f);
13 this.RefreshAll();
14 }
15
16 // Token: 0x06000B13 RID: 2835 RVA: 0x00045134 File Offset: 0x00043334
17 public override void Refresh()
18 {
19 this.timer += Time.deltaTime;
20 if (this.timer > 0.2f)
21 {
22 this.timer = 0f;
23 this.RefreshAll();
24 }
25 if (!this.owner.isHidden || EMono.pc.CanSee(this.owner))
26 {
27 if (!base.gameObject.activeSelf)
28 {
29 base.gameObject.SetActive(true);
30 }
31 base.transform.position = this.owner.renderer.position;
32 return;
33 }
34 if (base.gameObject.activeSelf)
35 {
36 base.gameObject.SetActive(false);
37 }
38 }
39
40 // Token: 0x06000B14 RID: 2836 RVA: 0x000451E4 File Offset: 0x000433E4
41 public void RefreshAll()
42 {
43 CoreRef.OrbitIcons orbitIcons = EMono.core.refs.orbitIcons;
44 Emo2 emo = Emo2.none;
45 if (this.owner.IsInstalled)
46 {
47 if (this.owner.isRestocking && !this.owner.IsPCParty && this.owner.trait.GetRestockedIcon() != Emo2.none && !(EMono._zone is Zone_Dungeon))
48 {
49 emo = this.owner.trait.GetRestockedIcon();
50 }
51 else
52 {
53 Thing thing = EMono.player.currentHotItem.Thing;
54 if (((thing != null) ? thing.trait : null) is TraitToolShears && this.owner.CanBeSheared())
55 {
56 emo = Emo2.fur;
57 }
58 }
59 }
60 bool flag = emo > Emo2.none;
61 if (flag)
62 {
63 this.iconStatus.sprite = EMono.core.refs.spritesEmo[(int)emo];
64 }
65 this.iconStatus.SetActive(flag);
66 }
67
68 // Token: 0x04000A28 RID: 2600
69 public GameObject goIcon;
70
71 // Token: 0x04000A29 RID: 2601
72 public SpriteRenderer iconStatus;
73
74 // Token: 0x04000A2A RID: 2602
75 public new Thing owner;
76
77 // Token: 0x04000A2B RID: 2603
78 private float timer;
79}
Definition EMono.cs:6
Definition Thing.cs:10