Exemplo n.º 1
0
        // Start is called before the first frame update
        void Start()
        {
            ambientSpriteRenderer = GetComponent <SpriteRenderer>();
            targetColor           = ambientSpriteRenderer.color;
            ratio = TimeOfTheDay.DayLengthInSeconds / 86400f;

            if (TimeOfTheDay != null)
            {
                targetColor = AmbientHourColorsList[TimeOfTheDay.GetGameTime().Hours];
            }
        }
Exemplo n.º 2
0
 public override void UpdateMe()
 {
     if (TimeOfTheDay != null)
     {
         var currentGameTime = TimeOfTheDay.GetGameTime();
         var textComp        = GetComponent <Text>();
         textComp.text = string.Format(Format,
                                       currentGameTime.Days,
                                       currentGameTime.Hours.ToString().Length == 1 ? ("0" + currentGameTime.Hours.ToString()) : currentGameTime.Hours.ToString(),
                                       currentGameTime.Minutes.ToString().Length == 1 ? ("0" + currentGameTime.Minutes.ToString()) : currentGameTime.Minutes.ToString(),
                                       currentGameTime.Seconds);
     }
 }
Exemplo n.º 3
0
        public override void UpdateMe()
        {
            tweenLength = 0f;
            if (TimeOfTheDay != null)
            {
                var currentGameTime = TimeOfTheDay.GetGameTime();
                targetColor = AmbientHourColorsList[currentGameTime.Hours];
                // if (currentGameTime.Hours >= 6 && currentGameTime.Hours <= 18)
                // {
                //     targetColor = DayColor;
                //     tweenLength = ratio * 10 * 60;
                // }
                // else
                // {
                //     targetColor = NightColor;
                //     tweenLength = ratio * 14 * 60;
                // }

                // if (currentGameTime.Hours >= 0 && currentGameTime.Hours <= 4)
                // {
                //     targetColor = NightColor;
                //     tweenLength  = ratio * (4/24);
                // }
                // else
                // if (currentGameTime.Hours > 4 && currentGameTime.Hours <= 9)
                // {
                //     targetColor = MorningColor;
                //     tweenLength  = ratio * (5/24);
                // }
                // else if (currentGameTime.Hours > 9 && currentGameTime.Hours <= 15)
                // {
                //     targetColor = DayColor;
                //     tweenLength  = ratio * (6/24);
                // }
                // else if (currentGameTime.Hours > 15 && currentGameTime.Hours <= 18)
                // {
                //     targetColor = DuskColor;
                //     tweenLength  = ratio * (3/24);
                // }
                // else if ( currentGameTime.Hours > 18 && currentGameTime.Hours <= 21)
                // {
                //     targetColor = NightColor;
                //     tweenLength  = ratio * (3/24);
                // }
            }
        }
Exemplo n.º 4
0
        public override void UpdateMe()
        {
            var currentGameTime = TimeOfTheDay.GetGameTime();

            targetAngle = (currentGameTime.Hours * 360) / 24;
        }