示例#1
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        mov    = player.GetComponent <MoveVehicle> ();

        //showing = false;

        //canv = player.GetComponent<Canvas> ();

        myCam = player.GetComponent <canMouseLook> ();
    }
    void endGame()
    {
        // Disable movement from the character
        CharacterControl cc = player.GetComponent <CharacterControl>();

        cc.speed     = 0;
        cc.jumpSpeed = 0;

        // Show end screen
        Instantiate(canvas, new Vector3(0, 0, 0), Quaternion.identity);

        // Get script and disable it by multiplying sensitivity by 0
        canMouseLook mouse = player.GetComponentInChildren <canMouseLook>();

        mouse.sensititiy = 0;
    }