示例#1
0
    void Awake()
    {
        player         = GameObject.FindGameObjectWithTag("Player");
        slidingPuzzle  = GameObject.FindObjectOfType <SlidingPuzzle>();
        switchesPuzzle = GameObject.FindObjectOfType <SwitchPuzzle>();
        colorPuzzle    = GameObject.FindGameObjectWithTag("ColorPuzzle");

        treeCollider = GameObject.FindGameObjectWithTag("Tree").GetComponent <Collider>();

        if (slidingPuzzle && switchesPuzzle && colorPuzzle)
        {
            Destroy(treeCollider);
        }

        if (colorPuzzle)
        {
            player.transform.position = new Vector3(70, 9, 86);
            player.transform.Rotate(0, 20f, 0);
        }
        else if (switchesPuzzle.solved())
        {
            player.transform.position = new Vector3(11, 9, 86);
        }
        else if (slidingPuzzle.solved())
        {
            player.transform.position = new Vector3(-48, 9, 86);
            player.transform.Rotate(0, -37f, 0);
        }
    }
示例#2
0
 void Awake()
 {
     door           = GameObject.FindGameObjectWithTag("SF_Door2");
     switchesPuzzle = GameObject.FindObjectOfType <SwitchPuzzle>();
 }