Esempio n. 1
0
    public void MakeGhost()
    {
        // make me invisible for everyone
        this.transform.GetChild(0).GetComponent <MeshRenderer>().enabled = false;

        this.gameObject.tag = "Untagged";
        if (photonView.IsMine) // only disable my controllers for me
        {
            this.GetComponent <CharacterController>().enabled = false;
            this.GetComponent <BunnyController>().enabled     = false;
            GhostMode spectator = this.GetComponent <GhostMode>();
            spectator.ActivateSpectate();
            this.GetComponent <BoxCollider>().enabled = true; // collider for ghost mode

            Camera.main.GetComponent <FollowCam>().pitch_min_max.x = -25f;
        }
    }