private void Awake() { NullChecks(); ResizeButtons(); void NullChecks() { bool fatal = false; if (playButton == null) { Debug.LogError("No play button given."); fatal = true; } if (pauseButton == null) { Debug.LogError("No pause button given."); fatal = true; } if (simController == null) { simController = GetComponentInParent <NDSimulationController>(); if (simController == null) { Debug.LogError("No sim controller found."); fatal = true; } } if (fatal) { Destroy(this); } } }
private void Awake() { NullChecks(); ReadGradients(); void NullChecks() { if (display == null) { display = GetComponentInParent <GradientDisplay>(); if (display == null) { Destroy(this); Debug.LogError("No GradientDisplay given."); } } if (simController == null) { simController = GetComponentInParent <NDSimulationController>(); if (simController == null) { Debug.LogWarning("No sim controller found. Text colors might be wrong."); } } } }
private void Awake() { if (simController == null) { simController = GetComponentInParent <NDSimulationController>(); if (simController == null) { Debug.LogError("No simulation controller found."); } } }
private void Awake() { NullChecks(); bc = GetComponent <BoxCollider>(); gameObject.layer = LayerMask.NameToLayer("Raycast"); void NullChecks() { bool fatal = false; if (simController == null) { simController = GetComponentInParent <NDSimulationController>(); if (simController == null) { Debug.LogWarning("Could not find simulation controller. Text colors could be wrong."); } } if (increaseButton == null) { Debug.LogError("No increase button given."); fatal = true; } if (decreaseButton == null) { Debug.LogError("No decrease button given."); fatal = true; } if (resetButton == null) { Debug.LogError("No reset button given."); fatal = true; } if (fatal) { Destroy(this); } } }
private void Awake() { bool fatal = false; if (timerText == null) { Debug.LogError("No label found."); fatal = true; } if (simController == null) { simController = GetComponentInParent <NDSimulationController>(); if (simController == null) { Debug.LogError("No simulation controller found."); fatal = true; } } if (fatal) { Destroy(this); } }