Exemplo n.º 1
0
    void DirectorUpdate()
    {
        //Debug.LogError("DirectorUpdate Script Ran");

        //if (!isServer)
        //{
        //    //  Only the server should update the director
        //    return;
        //}

        if (directorReference == null)
        {
            //  Clients will not be able to get a director reference so do not continue
            return;
        }

        //Debug.Log("Director isDay = " + directorReference.isDay);
        //Debug.Log("isDay = " + isDay);
        //Debug.Log("isNIght = " + isNight);

        if (isDay)
        {
            //  Day time

            if (directorReference.isDay != isDay)
            {
                //  Director not set to day so update
                directorReference.SetDay();
            }
        }
        else
        {
            //  Night time

            if (directorReference.isDay != isDay)
            {
                //  Director is still set to day so switch to night

                directorReference.SetNight();
            }
        }
    }