public void ActivateShield() { _isShieldActive = true; _shieldPrefab.SetActive(true); _dissolveEffect.StopDissolve(1f); _shieldHits = 3; //_uIManager.ActivateShieldImage(); //_uIManager.UpdateShield(_shieldHits); //_shieldPrefab.GetComponentInChildren<Renderer>().material.color = Color.cyan; _dissolveEffect.ChangeShieldColour(3); Debug.Log("Shield hits is: " + _shieldHits); }
IEnumerator Teleport() { //Gets components needed DissolveEffect dissolveEffect = Player.GetComponent <DissolveEffect>(); PlayerMovement playerMovement = Player.GetComponent <PlayerMovement>(); Teleporter teleport = otherTeleporter.GetComponent <Teleporter>(); dissolveEffect.StartDissolve(2f); yield return(new WaitForSeconds(1f)); //Teleports the player PlayerController.isGamePaused = true; Player.transform.position = new Vector2(otherDestination.transform.position.x, otherDestination.transform.position.y); teleport.allowTeleport = false; dissolveEffect.StopDissolve(2f); yield return(new WaitForSeconds(0.35f)); PlayerController.isGamePaused = false; yield return(new WaitForSeconds(0.2f)); teleport.allowTeleport = true; }