private void RespawnPlayer() { PlayerMovement playerMov = GetComponentInParent <PlayerMovement>(); PlayerContainers playerCont = playerMov.GetComponent <PlayerContainers>(); HandMovement playerHand = playerMov.GetComponentInChildren <HandMovement>(); playerMov.ChangeControl(true); playerCont.ChangeControl(true); playerHand.ChangeControl(true); }
public void Death() { if (dead == false) { audioS.PlayOneShot(deathSound); dead = true; anim.SetBool("Dead", true); PlayerMovement playerMov = GetComponentInParent <PlayerMovement>(); PlayerContainers playerCont = playerMov.GetComponent <PlayerContainers>(); HandMovement playerHand = playerMov.GetComponentInChildren <HandMovement>(); playerMov.ChangeControl(false); playerCont.ChangeControl(false); playerHand.ChangeControl(false); StartCoroutine(RespawnPlayerCR(deathSound.length)); } }
public void SetPlayerControl(bool hasControl) { playerHasControl = hasControl; Cursor.visible = !hasControl; // TODO: Disable all player contrables at once. PlayerMovement playerMov = FindObjectOfType <PlayerMovement>(); PlayerContainers playerCont = playerMov.GetComponent <PlayerContainers>(); HandMovement playerHand = playerMov.GetComponentInChildren <HandMovement>(); ProjectilePath playerProjectile = playerMov.GetComponentInChildren <ProjectilePath>(); playerMov.ChangeControl(hasControl); playerCont.ChangeControl(hasControl); playerHand.ChangeControl(hasControl); playerProjectile.ChangeControl(hasControl); //TODO: Check this one out. // It highlights the first button in the menu if there is no mouse. //StartCoroutine(HighLightBtnCR()); }