Exemplo n.º 1
0
    public IEnumerator AttackButtle(Enemy enemy, Vector3 pos, float time)
    {
        AudioMananger.PlaySound("attack");
        yield return(new WaitForSeconds(time));

        Bullet bullet = BulletManager.CreatBullet(mBulletModelName);

        if (enemy != null)
        {
            bullet.InitData(enemy, BulletMoveSpd, mAttack);
        }
        else
        {
            bullet.InitData(pos, BulletMoveSpd, mAttack);
        }
        bullet.transform.localPosition = transform.localPosition;
    }