예제 #1
0
    void Awake()
    {
        GameObject temp = GameObject.FindGameObjectWithTag("HintBox");

        if (ErrorWindow <PowerUpGameObjects> .CanBeAssigned(temp, this, "HintBox"))
        {
            hintbox = temp.GetComponent <HintBoxController> ();
        }

        GameObject tempflash = GameObject.FindGameObjectWithTag("FlashingTextBox");

        if (ErrorWindow <PowerUpGameObjects> .CanBeAssigned(tempflash, this, "FlashingTextBox"))
        {
            flashText = tempflash.GetComponent <FlashingTextController> ();
        }

        GameObject soundDirObj = GameObject.FindGameObjectWithTag("SoundDirector");

        if (soundDirObj != null)
        {
            soundDirector = soundDirObj.GetComponent <SoundDirector> ();
        }
        else
        {
            Debug.Log("Cannot find the SoundDirector!");
        }
    }
예제 #2
0
    // Use this for initialization
    void Awake()
    {
        GameObject soundDirObj = GameObject.FindGameObjectWithTag("SoundDirector");

        if (soundDirObj != null)
        {
            soundDirector = soundDirObj.GetComponent <SoundDirector> ();
        }
        else
        {
            Debug.Log("Cannot find the SoundDirector!");
        }

        GameObject directorObj = GameObject.FindGameObjectWithTag("Director");

        if (directorObj != null)
        {
            director = directorObj.GetComponent <Director> ();
        }
        else
        {
            Debug.Log("Cannot find the SoundDirector!");
        }



        pieces = new List <GameObject>();
        foreach (Transform child in transform)
        {
            if (child.tag == "hiddenPuzzlePieces")
            {
                pieces.Add(child.gameObject);
            }
        }
        totalPiecesLeft = pieces.Count;

        if (pieces.Count == 1)
        {
            onlyOneChild = true;
        }


        GameObject temp = GameObject.FindGameObjectWithTag("HintBox");

        if (ErrorWindow <PuzzlePlatform> .CanBeAssigned(temp, this, "HintBox"))
        {
            hintbox = temp.GetComponent <HintBoxController> ();
            hintbox.AddObj(gameObject);
        }

        GameObject tempFlash = GameObject.FindGameObjectWithTag("FlashingTextBox");

        if (ErrorWindow <PuzzlePlatform> .CanBeAssigned(tempFlash, this, "FlashingTextBox"))
        {
            flashText = tempFlash.GetComponent <FlashingTextController> ();
            flashText.AddObj(gameObject);
        }
    }
예제 #3
0
    void Awake()
    {
        print("puzzle inventory awake");
        GameObject temp = GameObject.FindGameObjectWithTag("HintBox");

        if (ErrorWindow <PuzzlePieceActivator> .CanBeAssigned(temp, this, "HintBox"))
        {
            hintbox = temp.GetComponent <HintBoxController> ();
        }
        GameObject soundDirObj = GameObject.FindGameObjectWithTag("SoundDirector");

        if (soundDirObj != null)
        {
            soundDirector = soundDirObj.GetComponent <SoundDirector> ();
        }
        else
        {
            Debug.Log("Cannot find the SoundDirector!");
        }
    }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        GameObject directorObj = GameObject.FindGameObjectWithTag("Director");
        GameObject soundDirObj = GameObject.FindGameObjectWithTag("SoundDirector");

        if (directorObj != null)
        {
            director = directorObj.GetComponent <Director> ();
        }
        else if (directorObj == null)
        {
            Debug.Log("Cannot find the Director!");
        }
        if (soundDirObj != null)
        {
            soundDirector = soundDirObj.GetComponent <SoundDirector> ();
        }
        else
        {
            Debug.Log("Cannot find the SoundDirector!");
        }

        GameObject obj = GameObject.FindGameObjectWithTag("Player");

        if (obj != null)
        {
            player = obj.GetComponent <PlayerPositioning>();
            shrink = obj.GetComponent <ShrinkPlayer>();
        }
        else if (obj == null)
        {
            Debug.Log("cannot find PlayerControls!");
        }

        soulmeter = GameObject.FindGameObjectWithTag("Soulmeter");
    }
예제 #5
0
 void Awake()
 {
     hintBox       = GameObject.FindGameObjectWithTag("HintBox").GetComponent <HintBoxController> ();
     flashText     = GameObject.FindGameObjectWithTag("FlashingTextBox").GetComponent <FlashingTextController> ();
     soundDirector = GameObject.FindGameObjectWithTag("SoundDirector").GetComponent <SoundDirector> ();
 }