/// <summary>
    /// 
    /// </summary>
    public void OnEvent(bool isLocal = false)
    {
        if (!this.enabled)
            return;

        if (isLocal || PhotonNetwork.offlineMode)
        {
            m_Event.Invoke();
        }
        else
        {
            //Send RPC to master to invoke 
            photonView.RPC("RpcInvokeEvent", m_Target);
        }
    }
Ejemplo n.º 2
0
    private void Day()
    {
        if (!this.enabled)
        {
            return;
        }

        m_OnDayEvent.Invoke();
    }
Ejemplo n.º 3
0
 private void Update()
 {
     transform.Rotate(Vector3.right, 360.0f / dayNightCycleDuration * Time.deltaTime);
     if (night != (moon.position.y >= (sun.position.y + 1.5f)))
     {
         night = !night;
         if (night)
         {
             OnNight?.Invoke();
         }
         else
         {
             OnDay?.Invoke();
         }
     }
 }
Ejemplo n.º 4
0
    public bool TurnDay(bool isButtonCalled)
    {
        if (isToogleBlocked)
        {
            return(false);
        }

        if (isButtonCalled)
        {
            cashedIsDay = true;
            StartCoroutine(Cooldown());
        }

        OnDay?.Invoke();
        isDay = true;
        return(true);
    }