bi3mer / SeniorProject

Senior Project Game
MIT License
1 stars 1 forks source link

fixes clock so half hour and hour delegates are called properly #887

Closed bi3mer closed 7 years ago

bi3mer commented 7 years ago

I just put this in floodwater.cs to test:

    void halfHourUpdate() 
    {
        Debug.Log("half hour has passed!");
    }

    void hourUpdate() 
    {
        Debug.Log("HOur has passed");
    }

    /// <summary>
    /// Set the base water level at the start and set up tide 
    /// water levels for day and night
    /// </summary>
    void Start()
    {
        // create night and day tide positions
        this.nightPosition = this.dayPosition = this.transform.position;
        this.dayPosition.y += this.TideSeverity + this.TideSeverity;

        // subscribe precipitation updates to the clock
        Game.Instance.ClockInstance.SecondUpdate += this.updatePrecipitationLevel;
        Game.Instance.ClockInstance.HalfHourUpdate += this.halfHourUpdate;
        Game.Instance.ClockInstance.HourUpdate += this.hourUpdate;
    }