1. I am trying to trigger a function on 00:00.
    Code:
    void OnTick()
            {
                if (TOD_Sky.Instance.Cycle.Hour == 0) // 00:00
                {
                    //do something
                }
            }
    Obviously that does not work so I did this: "(TOD_Sky.Instance.Cycle.Hour >= 23.99)".
    Is there a better way to do this?
     
  2. If I'm not mistaken, then you can add callbacks to TOD_Time.OnDay. Haven't tried it, though.
     
  3. Sorry sqroot, I am a little confused. Can you explain it a little more?

    Thank you.
     
  4. TOD_Time has a member OnDay:
    Code:
    public event Action OnDay
    {
      [MethodImpl(MethodImplOptions.Synchronized)]
      add
      {
        this.OnDay = (Action)Delegate.Combine(this.OnDay, value);
      }
      [MethodImpl(MethodImplOptions.Synchronized)]
      remove
      {
        this.OnDay = (Action)Delegate.Remove(this.OnDay, value);
      }
    }
    TOD_Time can be accessed like: TOD_Sky.Instance.Components.Time
    The rest is C# specific ;)
     
  5. Something simple I use to reference Time of day and do something
    Used similar coding for my fishing plugin to give bonus to fishing in morning and evening.

    Just a idea :)

    Code:
    float currenttime = TOD_Sky.Instance.Cycle.Hour;
        if (currenttime < 8 && currenttime > 6)
            {
            MakeMyCoffee(player, strong);
            }
    
     
    Last edited by a moderator: Jul 11, 2016