Пример #1
0
    private void Awake()
    {
        playButton = GameObject.FindGameObjectWithTag("uiPlayButton").GetComponent <Button>();
        if (playButton == null)
        {
            Debug.Log("Menu Button couldnt get a reference to the Play Button");
        }

        fpPanel = GameObject.FindGameObjectWithTag("uiFinalPlayPanel").GetComponent <FinalPlayPanel>();
        if (fpPanel == null)
        {
            Debug.Log("Menu button couldnt get a reference to the Final Play Panel Script.");
        }

        daScript = GameObject.FindGameObjectWithTag("uiDownArrow").GetComponent <DownArrowScript>();
        if (daScript == null)
        {
            Debug.Log("Menu button script couldnt get reference to the down arrow script.");
        }

        charSelectSub = GameObject.FindGameObjectWithTag("uiCharSubPanel");
        if (charSelectSub == null)
        {
            Debug.Log("Menu Button Script couldnt get a reference to the ui Char Select Sub Panel.");
        }
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        playPanel = GameObject.FindGameObjectWithTag("uiFinalPlayPanel");
        if (playPanel == null)
        {
            Debug.Log("FinalPlay Back Button couldnt get a reference to the FinalPlayPanel Object");
        }
        else
        {
            fpPanel = playPanel.GetComponent <FinalPlayPanel>();
            if (fpPanel == null)
            {
                Debug.Log("FinalPlay Back button couldnt get reference to the Final Play Panel Script");
            }
        }

        bbText = new Text[2]; // should be only two...
        button = GetComponent <Button>();
        if (button == null)
        {
            Debug.Log("FinalPlay Back Button script could not get a reference to the button sript.");
        }
        else
        {
            button.onClick.AddListener(GoBack);

            Text[] t = button.gameObject.GetComponentsInChildren <Text>();
            if (t != null)
            {
                for (int i = 0; i < t.Length; i++)
                {
                    bbText[i] = t[i];
                    if (bbText[i] == null)
                    {
                        Debug.Log("FinalPlay Back Button couldnt get a reference to one of its child Text component.");
                    }
                }
            }
        }

        audioOut = GetComponent <AudioSource>();
        if (audioOut == null)
        {
            Debug.Log("FinalPlay Back Button couldnt get its Audio Source component.");
        }

        pScript = GameObject.FindGameObjectWithTag("PlayerController").GetComponent <PlayerController>();
        if (pScript == null)
        {
            Debug.Log("FinalPlay Back Button script could not get a reference to the Player controller.");
        }

        //playPanel.SetActive(false);
    }
Пример #3
0
 void Awake()
 {
     playPanel = GameObject.FindGameObjectWithTag("uiFinalPlayPanel");
     if (playPanel == null)
     {
         Debug.Log("Next Button couldnt get a reference to the FinalPlayPanel Object");
     }
     else
     {
         fpPanel = playPanel.GetComponent <FinalPlayPanel>();
         if (fpPanel == null)
         {
             Debug.Log("Next button couldnt get reference to the Final Play Panel Script");
         }
     }
 }