void Start() { myCityStreamManager = CityStreamManager.Instance; if (!myCityStreamManager) { Debug.LogError("CameraMover:: Cannot find CityStreamManager in this scene. Demo will not function correctly!"); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif } }
void Awake() { if (_instance != null) { Debug.Log("CityStreamManager:: Duplicate instance of CityStreamManager, deleting second instance."); Destroy(this.gameObject); } else { _instance = this; } }
void Start() { configNameLabel = gameObject.transform.Find("DemoCanvas/ConfigNameLabel").GetComponent <Text>(); speedLabel = gameObject.transform.Find("DemoCanvas/SpeedLabel").GetComponent <Text>(); currentBufferBlockLabel = gameObject.transform.Find("DemoCanvas/CurrentBufferBlockLabel").GetComponent <Text>(); pressSpaceToStartLabel = gameObject.transform.Find("DemoCanvas/PressSpaceToStartLabel").GetComponent <Text>(); if (!configNameLabel || !speedLabel || !currentBufferBlockLabel || !pressSpaceToStartLabel) { Debug.LogWarning("ParadeDemoUI:: Cannot find one or more UI components. UI will not draw properly."); } myCityStreamManager = CityStreamManager.Instance; myCameraMover = CameraMover.Instance; if (!myCityStreamManager || !myCameraMover) { Debug.LogError("ParadeDemoUI:: Cannot find CityStreamManager and/or CameraMover in this scene. Demo will not function correctly!"); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif } if (myCityStreamManager.EnableTestUI) { drawUI = true; configNameLabel.enabled = true; speedLabel.enabled = true; currentBufferBlockLabel.enabled = true; pressSpaceToStartLabel.enabled = true; // UI Elements that don't change (will reduce "performance artifacts" due to unrequired UI updates) configNameLabel.text = "Test Name: '" + myCityStreamManager.CurrentConfigName + "'"; } else { drawUI = false; configNameLabel.enabled = false; speedLabel.enabled = false; currentBufferBlockLabel.enabled = false; pressSpaceToStartLabel.enabled = false; } }