Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Changing a skybox via C#

$
0
0
Good evening all. I've been all over these forums looking at solutions to this, but I'm still getting errors.

Here's my code so far.

Code (csharp):
  1.  
  2. using UnityEngine;
  3. using System;
  4.  
  5. public class DayNightCycle : MonoBehaviour {
  6.  
  7.     var dayMat : Material;
  8.     var nightMat : Material;
  9.  
  10.     void Update () {
  11.         changeSky();
  12.     }
  13.  
  14. private static void changeSky()
  15. {
  16.         var hours = System.DateTime.Now.Hour;
  17.          
  18.         if (hours == 18 || hours == 19 || hours == 20 || hours == 21 || hours == 22 ||...
Changing a skybox via C#

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>