// Start is called before the first frame update void Start() { //Fetch the Rigidbody from the GameObject with this script attached playerRigidbody = player.GetComponent <Rigidbody>(); PlayerMouse_Behaviour = player.GetComponent <Mouse_Behaviour>(); PlayAudio_Behaviour = player.GetComponent <Audio_Behaviour>(); //Slider timerSlider.maxValue = StartTIme; fill = timerSlider.transform.GetChild(1).GetChild(0).gameObject; fillImage = fill.GetComponent <Image> (); sk = Key.GetComponent <SelfRotation_Key>(); }
void setTurning(bool sure) { if (sure) { oldPosition = cameraFollow.transform.position; cameraFollow.transform.position = targetPoint.position; oldOrientation = cameraFollow.transform.rotation; cameraFollow.transform.LookAt(targetLookAt.transform.position); timebeforejump = delay; timerstarted = true; } else { cameraFollow.transform.rotation = oldOrientation; cameraFollow.transform.position = oldPosition; relocate = false; } //fin //cameraFollow.transform.rotation = Quaternion.Inverse(transform.rotation) * initialRotation; //cameraFollow.transform.position = transform.TransformVector(initialRelativPos); Rigidbody rb = GetComponent <Rigidbody>(); if (sure) { oldConstraints = rb.constraints; rb.constraints = RigidbodyConstraints.FreezeAll; } else { rb.constraints = oldConstraints; } Mouse_Behaviour behave = GetComponent <Mouse_Behaviour>(); if (behave) { behave.canMove = !sure; } Mouse_Rotation rotate = Queue.GetComponent <Mouse_Rotation>(); if (rotate) { rotate.canRotate = !sure; } }
// Start is called before the first frame update void Start() { behave = player.GetComponent <Mouse_Behaviour>(); }