// 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; }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); if (player == null) { Debug.Log("Could not find player"); } playerScript = player.GetComponent <FPS_Player>(); heatGain = playerScript.heatGain; }
public override FPS_Controller Possess(FPS_Player player) { guiCanvas.enabled = true; if (equipped != null) { equipped.gunCanvas.enabled = true; } return(base.Possess(player)); }
// Take Control and Initialize all components of the controller public virtual FPS_Controller Possess(FPS_Player player) { Debug.Log(name + ": Possessing"); owner = player; cam.enabled = true; cam.GetComponent <AudioListener>().enabled = true; cam.GetComponent <FlareLayer>().enabled = true; // Cursor Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; return(this); }