// public SeasonDictionary seasonStates; void Awake() { timeController = TimeController.Instance; seasons = gameObject.GetComponentsInChildren <Season>(); // seasonTimeMarks = new float[seasons.Length + 1]; seasonTimeMarks = new float[seasons.Length]; for (int i = 1; i < seasons.Length; i++) { seasonTimeMarks[i] = seasons[i].dateMark; } // seasonTimeMarks[seasonTimeMarks.Length-1] = seasons.First().dateMark+1f; }
// Start is called before the first frame update void Awake() { mainCanvasObject = GameObject.Find("MainCanvas"); Debug.Assert(mainCanvasObject != null, "Could not find <color=red>MainCanvas</color>.", gameObject); debugTextObject = GameObject.Find("DebugText"); Debug.Assert(debugTextObject != null, "Could not find <color=red>debugTextObject</color>.", gameObject); gameDateNormalizedText = GameObject.Find("GameDateNormalized").GetComponent <Text>(); Debug.Assert(gameDateNormalizedText != null, "Could not find <color=red>gameDateNormalizedText</color>.", gameObject); gameTimeText = GameObject.Find("GameTime").GetComponent <Text>(); Debug.Assert(gameTimeText != null, "Could not find <color=red>gameTimeText</color>.", gameObject); timeController = TimeController.Instance; // REFACTOR viewStateController = GameObject.Find("ViewController").GetComponent <ViewStateController>(); }
// Start is called before the first frame update void Start() { timeController = TimeController.Instance; leaves = GetComponentInChildren <ParticleSystem>(); var main = leaves.main; leaves.Stop(); // Cannot set duration whilst Particle System is playing main.startLifetime = lifespan; main.duration = lifespan; // main.duration = timeController.yearSeconds/timeController.timeScale; // main.duration = Mathf.Infinity; // main.startLifetime = timeController.yearSeconds/timeController.timeScale; // leaves.Simulate(timeController.gameDateNormalized * timeController.yearSeconds/timeController.timeScale); leaves.Play(); }
/// <summary> /// Assigns component references and TimeController singleton. /// </summary> void Awake() { locationController = LocationController.Instance; timeController = TimeController.Instance; }
// Start is called before the first frame update void Start() { timeController = TimeController.Instance; InitSiblings(); InitCurve(); }
// Start is called before the first frame update void Awake() { timeController = TimeController.Instance; theLight = gameObject.GetComponent <Light>(); lightController = gameObject.GetComponent <SeasonSunlightController>(); }