Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        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.");
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     if (simController == null)
     {
         simController = GetComponentInParent <NDSimulationController>();
         if (simController == null)
         {
             Debug.LogError("No simulation controller found.");
         }
     }
 }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }