Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public void WriteBinary(ESPWriter writer)
 {
     Sunrise.WriteBinary(writer);
     Day.WriteBinary(writer);
     Sunset.WriteBinary(writer);
     Night.WriteBinary(writer);
     HighNoon.WriteBinary(writer);
     Midnight.WriteBinary(writer);
 }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 void Start()
 {
     Player = GameObject.FindGameObjectWithTag("Player");
     stats  = Player.GetComponent <HighNoon>();
 }
Ejemplo n.º 8
0
 void Start()
 {
     Player        = GameObject.FindGameObjectWithTag("Player");
     stats         = Player.GetComponent <HighNoon>();
     rectTransform = clockHand.GetComponent <RectTransform>();
 }