private IEnumerator StartLoseCycle()
    {
        yield return(new WaitForSeconds(0.2f));

        var CameraControl = Camera.main.GetComponent <CameraController>();

        InputManager.CanReadInput = false;

        //Fade In Out and teleport player
        StartCoroutine(CameraControl.FadeIn(0.5f, 0.05f));
        while (CameraControl.fading)
        {
            yield return(new WaitForEndOfFrame());
        }
        StartCoroutine(CameraControl.FadeOut(0.5f, 0.05f));

        HealingInteractable Healpoint = Main.Instance.SceneMgr.ActiveSceneParam.SceneHealLocation;

        PlayerControl.Teleport(Healpoint.Location);
        PlayerControl.Turn(Healpoint.direction, PlayerControl.PlayerSprite, this.GetComponent <Animator>());

        yield return(new WaitForSeconds(0.5f));

        InputManager.CanReadInput = true;

        PlayerControl.HandleInteraction();
    }
    private void OnTriggerStay(Collider collision)
    {
        if (currentInterraction == null)
        {
            return;
        }
        currentInterraction.Interact();
        HealingInteractable healingInteractable = currentInterraction as HealingInteractable;

        if (healingInteractable != null)
        {
            healingInteractable.isHealing = false;
        }
    }
Example #3
0
 private void OnTriggerStay(Collider collision)
 {
     if (currentInterraction == null)
     {
         return;
     }
     if (Input.GetKey(KeyCode.E))
     {
         currentInterraction.Interact();
         HealingInteractable healingInteractable = currentInterraction as HealingInteractable;
         if (healingInteractable != null)
         {
             healingInteractable.isHealing = true;
         }
     }
 }