Example #1
0
    private void OnTriggerStay(Collider other)
    {
        if (TrapType2State != TrapType2State.normal)
        {
            return;
        }

        if (other.gameObject.tag == "Player")
        {
            TrapType2State = TrapType2State.readyForAttack;
            StartCoroutine("StartTrapType2Thorn");
        }
    }
Example #2
0
    IEnumerator StartTrapType2Thorn()
    {
        yield return(null);

        // 애니메이션 작동
        yield return(new WaitForSeconds(0.2f));

        rendererColor.material.color = Color.yellow;
        yield return(new WaitForSeconds(0.5f));

        rendererColor.material.color = Color.red;
        yield return(new WaitForSeconds(0.5f));

        attack();

        rendererColor.material.color = Color.white;
        yield return(new WaitForSeconds(2f));

        TrapType2State = TrapType2State.normal;
        StopCoroutine("StartTrapType2Thorn");
    }
Example #3
0
 void attack()
 {
     TrapType2State = TrapType2State.attack;
     Instantiate(fireBall, fireBallPos.position, fireBallPos.rotation);
 }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     TrapType2State = TrapType2State.normal;
 }