예제 #1
0
    // 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>();
    }
예제 #2
0
    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;
        }
    }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     behave = player.GetComponent <Mouse_Behaviour>();
 }