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 Start() { if (gradDisplay == null) { gradDisplay = GetComponentInParent <GradientDisplay>(); if (gradDisplay == null) { Debug.LogError("No gradient display found."); Destroy(this); } } }