private void Start() { if (dayAndNight == null) { dayAndNight = FindObjectOfType <DayAndNightCycle>(); } directionTransform = GetComponentInChildren <Transform>(); }
void Awake() { Instance = this; _dayPhases = DayPhases.Night; //Set day Phase to night on start up RenderSettings.ambientIntensity = _nightAmbientIntensity; //RenderSettings ambient intensity is equal to night startup //GetComponent<Light>().intensity = _nightSunIntensity; //Set sun intensity to night on start up /* * transform.position = //position is equal to * new Vector3( //a new vector 3 position * (_centreOfGameWorld * 2),0,_centreOfGameWorld); //at this position * * transform.localEulerAngles = new Vector3(0, -90, 0);//Suns rotation is equal to these (x, x, x) values */ lightAnims.SetBool("Playanim", true); lightAnims.speed = 0.01f; }
private Quaternion _defaultRotation; // used for resetting Day and Night Cycle in options to the midday private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } _seconds = dayCycleDuration * 0.5f; // hardcoded starting at the noon _defaultRotation = transform.rotation; _anglePerSecond = 180f / dayCycleDuration; _brightLanterns = new List <int>(); _brightWindows = new List <int>(); _brightWindowsChance = brightWindowsRatio / 100; _brightLanternsChance = brightLanternsRatio / 100; }