10 public override Vector3 FixPos
21 this.originalScale = base.transform.localScale;
22 this.originalAngle = base.transform.localEulerAngles;
26 public override void OnDraw(ref Vector3 pos)
28 if (this._mat != base.owner.material)
30 this._mat = base.owner.material;
34 bool flag = base.owner.dir == 2 || base.owner.dir == 3;
35 bool flag2 = base.owner.parent is
Chara && (base.owner.parent as
Chara).held == base.owner;
36 bool flag3 = base.owner.dir % 2 == 1;
37 bool flag4 = (this.alwaysFlip || !flag2) && flag3;
38 if (flag && this.flipBack)
42 bool flag5 = this.useOffsetBack && data.useOffsetBack && flag;
43 if (this.dirPos.Length == 0)
45 this.v.x = base.owner.renderer.position.x + (flag5 ? data.offsetBack.x : data.offset.x) * (
float)(flag4 ? -1 : 1) + this.FixPos.x +
this.flipFixX * (
float)(flag4 ? -1 : 1) + (flag2 ? (flag3 ? this.heldPosFlip.x :
this.heldPos.x) : 0f);
46 this.v.y = base.owner.renderer.position.y + (flag5 ? data.offsetBack.y : data.offset.y) + this.FixPos.y + (flag2 ? (flag3 ?
this.heldPosFlip.y :
this.heldPos.y) : 0f);
47 this.v.z = base.owner.renderer.position.z + (flag5 ? data.offsetBack.z : data.offset.z) + this.FixPos.z + (flag2 ? -0.5f : 0f) + (flag2 ? (flag3 ? this.heldPosFlip.z : this.heldPos.z) : 0f);
51 this.v.x = base.owner.renderer.position.x + (flag5 ? data.offsetBack.x : data.offset.x) + this.dirPos[base.owner.dir %
this.dirPos.Length].x + (flag2 ? (flag3 ?
this.heldPosFlip.x :
this.heldPos.x) : 0f);
52 this.v.y = base.owner.renderer.position.y + (flag5 ? data.offsetBack.y : data.offset.y) + this.dirPos[base.owner.dir %
this.dirPos.Length].y + (flag2 ? (flag3 ?
this.heldPosFlip.y :
this.heldPos.y) : 0f);
53 this.v.z = base.owner.renderer.position.z + (flag5 ? data.offsetBack.z : data.offset.z) + this.dirPos[base.owner.dir %
this.dirPos.Length].z + (flag2 ? -0.5f : 0f) + (flag2 ? (flag3 ? this.heldPosFlip.z : this.heldPos.z) : 0f);
55 base.transform.position = this.v;
56 if (this.flipSR && this.sr.flipX != flag4)
58 this.sr.flipX = flag4;
62 base.transform.localScale = (flag4 ?
new Vector3(this.originalScale.x * -1f,
this.originalScale.y,
this.originalScale.z) : this.originalScale);
63 base.transform.localEulerAngles = (flag4 ?
new Vector3(this.originalAngle.x * -1f,
this.originalAngle.y,
this.originalAngle.z) : this.originalAngle);
65 bool flag6 = (!this.onlyInstalled || base.owner.IsInstalled || base.owner.isRoofItem) && base.owner.trait.UseExtra;
66 TCExtra.Type type = this.type;
67 if (type !=
TCExtra.Type.Effect)
69 if (type !=
TCExtra.Type.QuestBoard)
74 using (List<Quest>.Enumerator enumerator =
EMono.game.quests.globalList.GetEnumerator())
76 while (enumerator.MoveNext())
78 Quest quest = enumerator.Current;
79 if (quest.IsVisibleOnQuestBoard() && quest.isNew)
90 if (traitEffect.timer < Time.realtimeSinceStartup)
92 traitEffect.timer = Time.realtimeSinceStartup - Time.realtimeSinceStartup % traitEffect.Interval + traitEffect.Interval + traitEffect.data.delay;
93 traitEffect.Proc(this.v);
97 if (this.hack ==
TCExtra.Hack.Candle)
99 foreach (Transform transform
in this.listTrans)
103 if (transform.localPosition.z > 0f)
105 transform.localPosition = transform.localPosition.SetZ(-transform.localPosition.z);
108 else if (transform.localPosition.z < 0f)
110 transform.localPosition = transform.localPosition.SetZ(-transform.localPosition.z);
114 if (base.owner.isHidden && base.owner.isChara && !
EMono.pc.CanSee(base.owner.Chara))
118 if (base.gameObject.activeSelf != flag6)
120 base.gameObject.SetActive(flag6);
125 public override void OnSetOwner()
132 public void RefreshColor()
136 Color color = base.owner.trait.ColorExtra ?? Color.white;
137 color.a = this.sr.color.a;
138 this.sr.color = color;
140 if (this.colorParticle)
142 ParticleSystem[] componentsInChildren = base.GetComponentsInChildren<ParticleSystem>();
143 for (
int i = 0; i < componentsInChildren.Length; i++)
145 ParticleSystem.MainModule main = componentsInChildren[i].main;
146 main.startColor = (base.owner.isDyed ? base.owner.DyeMat : base.owner.material).GetColor().SetAlpha(main.startColor.color.a);
152 public TCExtra.Type type;
155 public TCExtra.Hack hack;
158 public Vector3 fixPos;
161 public Vector3 heldPos;
164 public Vector3 heldPosFlip;
167 public float flipFixX;
173 public bool flipSelf;
176 public bool onlyInstalled =
true;
179 public bool useOffsetBack =
true;
182 public bool alwaysFlip;
185 public bool flipBack;
188 public bool colorParticle;
191 public SpriteRenderer sr;
194 public Transform[] listTrans;
197 public Vector3[] dirPos;
206 private Vector3 originalScale;
209 private Vector3 originalAngle;