コード例 #1
0
ファイル: EnemyController.cs プロジェクト: oxters168/QuestBow
    public virtual void Spawn(Vector3 position, Quaternion rotation, System.Action onExpired = null)
    {
        isDead = false;

        diedAt = -1;
        health.SetPercent(1);

        selfTargetRoot.position = position;
        selfTargetRoot.rotation = rotation;

        StartCoroutine(UnityHelpers.CommonRoutines.WaitToDoAction(success =>
        {
            ArrowController.DestroyArrowsInObject(transform);
            onExpired?.Invoke();
        }, 0, () =>
        {
            return(IsDead() && Time.time - diedAt >= behaviour.deathTime);
        }));
    }
コード例 #2
0
 public void Revive()
 {
     ArrowController.DestroyArrowsInObject(transform);
     isDead = false;
     birdBody.isKinematic = true;
 }