Inheritance: MonoBehaviour
Exemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("items"))
        {
            AttackPenPad pen = collision.GetComponent <AttackPenPad>();
            AttackIce    ice = collision.GetComponent <AttackIce>();

            if (pen != null)
            {
                if (pen.isShoot && pen.whoUse != PlayerOrder)
                {
                    effectAnim.SetTrigger("Star");
                    audioSource.PlayOneShot(hit);
                }
            }
            else if (ice != null)
            {
                if (ice.isShoot && ice.whoUse != PlayerOrder)
                {
                    effectAnim.SetTrigger("Water");
                    audioSource.PlayOneShot(glass);
                }
            }
        }
    }
Exemplo n.º 2
0
    private IEnumerator SmallDelay()
    {
        yield return(new WaitForSeconds(.3f));

        AttackIce iceball = Instantiate(icePrefab, sampledPoint, Quaternion.Euler(Random.insideUnitSphere));

        iceball.generatedByBoss = isBoss;
    }