Example #1
0
        // 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;
        }
Example #2
0
 // 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>();
 }
Example #3
0
        // 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();
        }
Example #4
0
 /// <summary>
 /// Assigns component references and TimeController singleton.
 /// </summary>
 void Awake()
 {
     locationController = LocationController.Instance;
     timeController     = TimeController.Instance;
 }
Example #5
0
 // Start is called before the first frame update
 void Start()
 {
     timeController = TimeController.Instance;
     InitSiblings();
     InitCurve();
 }
Example #6
0
 // Start is called before the first frame update
 void Awake()
 {
     timeController  = TimeController.Instance;
     theLight        = gameObject.GetComponent <Light>();
     lightController = gameObject.GetComponent <SeasonSunlightController>();
 }