Exemple #1
0
    void focusCube()
    {
        newCamera objCam = GameObject.FindObjectOfType <Camera>().GetComponent <newCamera>();

        objCam.controlledCube = gameObject;
        objCam.Focus          = true;

        if (objCam.controlledCube.tag == "Giant")
        {
            objCam.isGiant = true;
        }
        else
        {
            objCam.isGiant = false;
        }
    }
Exemple #2
0
    void Update()
    {
        if (isControlled == true)
        {
            Move();
        }

        if (Input.GetKeyDown(KeyCode.E) && IsPlayerCube)
        {
            resetControl();
            newCamera objCam = GameObject.FindObjectOfType <Camera>().GetComponent <newCamera>();
            objCam.controlledCube = gameObject;
            isControlled          = true;
            UpdateControlChild();
            focusCube();
        }
    }