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; } }
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(); } }