private void OnTriggerStay2D(Collider2D collision) { if (collision.isTrigger) { return; } HighNoon attr = collision.GetComponent <HighNoon>(); if (attr == null) { return; } if (attr.charge >= maxCharge || attr.isActive()) { return; } // You actually pick this up if (Max) { attr.charge = maxCharge; } else if (attr.charge + Charge > maxCharge) { attr.charge = maxCharge; } else { attr.charge += Charge; } Destroy(this.gameObject); }
public void ReadXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("Sunrise", false, out subEle)) { Sunrise.ReadXML(subEle, master); } if (ele.TryPathTo("Day", false, out subEle)) { Day.ReadXML(subEle, master); } if (ele.TryPathTo("Sunset", false, out subEle)) { Sunset.ReadXML(subEle, master); } if (ele.TryPathTo("Night", false, out subEle)) { Night.ReadXML(subEle, master); } if (ele.TryPathTo("HighNoon", false, out subEle)) { HighNoon.ReadXML(subEle, master); } if (ele.TryPathTo("Midnight", false, out subEle)) { Midnight.ReadXML(subEle, master); } }
public void WriteBinary(ESPWriter writer) { Sunrise.WriteBinary(writer); Day.WriteBinary(writer); Sunset.WriteBinary(writer); Night.WriteBinary(writer); HighNoon.WriteBinary(writer); Midnight.WriteBinary(writer); }
public void ReadBinary(ESPReader reader) { try { Sunrise.ReadBinary(reader); Day.ReadBinary(reader); Sunset.ReadBinary(reader); Night.ReadBinary(reader); HighNoon.ReadBinary(reader); Midnight.ReadBinary(reader); } catch { return; } }
public void Awake() { highNoon = this.GetComponent <HighNoon>(); if (highNoon == null) { highNoon = this.gameObject.AddComponent <HighNoon>(); } if (control == null) { DontDestroyOnLoad(this.gameObject); control = this.gameObject; } else if (control != this.gameObject) { Destroy(this.gameObject); } }
public void WriteXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Sunrise", true, out subEle); Sunrise.WriteXML(subEle, master); ele.TryPathTo("Day", true, out subEle); Day.WriteXML(subEle, master); ele.TryPathTo("Sunset", true, out subEle); Sunset.WriteXML(subEle, master); ele.TryPathTo("Night", true, out subEle); Night.WriteXML(subEle, master); ele.TryPathTo("HighNoon", true, out subEle); HighNoon.WriteXML(subEle, master); ele.TryPathTo("Midnight", true, out subEle); Midnight.WriteXML(subEle, master); }
void Start() { Player = GameObject.FindGameObjectWithTag("Player"); stats = Player.GetComponent <HighNoon>(); }
void Start() { Player = GameObject.FindGameObjectWithTag("Player"); stats = Player.GetComponent <HighNoon>(); rectTransform = clockHand.GetComponent <RectTransform>(); }