public override TPS_Controller Possess(TPS_Player player) { // Cursor Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; return(base.Possess(player)); }
// Disable all the components of the controller and put it to sleep public virtual void Eject() { Debug.Log(name + " : Ejecting"); owner = null; cam.enabled = false; cam.GetComponent <AudioListener>().enabled = false; cam.GetComponent <FlareLayer>().enabled = false; }
// Take Control and Initialize all components of the controller public virtual TPS_Controller Possess(TPS_Player player) { Debug.Log(name + ": Possessing"); owner = player; cam.enabled = true; cam.GetComponent <AudioListener>().enabled = true; cam.GetComponent <FlareLayer>().enabled = true; return(this); }
public override TPS_Controller Possess(TPS_Player player) { guiCanvas.enabled = true; // Cursor -- Confined lock mode doesn't work in editor, but does in standalone game. // For testing purposes, we'll use None as our lockmode in the editor. if (Application.isEditor) { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } else { Cursor.lockState = CursorLockMode.Confined; Cursor.visible = true; } return(base.Possess(player)); }