예제 #1
0
    private IEnumerator HurtBySpike(PlayerCore player)
    {
        player.Hurt(1, player.transform.position + new Vector3(Random.Range(-1.0f, 1.0f), -2f));
        Enabled = false;
        player.ControlAllowed = false;
        yield return(new WaitForSeconds(0.2f));


        if (player.CurrentHealth > 0)
        {
            ChapterManager.Instance.PlayerToLastPoint();
            player.RBody.velocity = Vector2.zero;

            yield return(new WaitForSeconds(1.0f));

            player.ControlAllowed = true;
            Enabled = true;
        }
    }