//Revives the player, and moves the submarine upward private IEnumerator ReviveProcess() { //Change the texture to intact, and play the revive particle subRenderer.sprite = subTextures[currentSkinID * 2 + 1]; reviveParticle.Play(); //Reset rotation, and move the submarine up newRotation = new Vector3(0, 0, 0); this.transform.eulerAngles = newRotation; StartCoroutine(FunctionLibrary.MoveElementBy(this.transform, new Vector2(0, Mathf.Abs(this.transform.position.y - maxDepth)), 0.5f)); yield return(new WaitForSeconds(0.5f)); //Reset states playerStatus = PlayerStatus.Idle; playerState = PlayerState.Enabled; playerVulnerability = PlayerVulnerability.Enabled; bubbles.Play(); yield return(new WaitForSeconds(0.5f)); powerupUsage = PowerupUsage.Enabled; reviveParticle.Clear(); }
//Enables the submarine public void EnableSubmarine() { playerStatus = PlayerStatus.Idle; playerState = PlayerState.Enabled; playerVulnerability = PlayerVulnerability.Enabled; powerupUsage = PowerupUsage.Enabled; subRenderer.sprite = subTextures[currentSkinID * 2 + 1]; bubbles.Play(); StartCoroutine(FunctionLibrary.MoveElementBy(this.transform, new Vector2(0.4f, 0.2f), 0.5f)); }