Exemplo n.º 1
0
    private IEnumerator ChargeEvent()
    {
        float
            minSize = .4f,
            maxSize = .8f;

        charge = minSize;
        animator.SetBool("Charge", true);
        chargeEffect.Play();

        currentBullet = bulletPool.GetFromPool();
        currentBullet.transform.parent   = chargePos;
        currentBullet.transform.position = chargePos.position;
        Bullet b = currentBullet.GetComponent <Bullet>();

        b.ChargeSetup(playerID, 1);
        b.GetComponent <SpriteRenderer>().color = Color.white;
        currentBullet.SetActive(true);

        while (charge < maxSize)
        {
            b.ChargeSetup(playerID, charge);
            yield return(new WaitForFixedUpdate());

            charge += .005f;
        }
    }
Exemplo n.º 2
0
 public void Attack(double atk)
 {
     if (!anim.GetBool(AnimationHashList.AnimHashDead))
     {
         anim.SetBool(AnimationHashList.AnimHashAttack, true);
         Bullet t = bulletP.GetFromPool();
         t.transform.position = bulletPos.position;
         t.SetAtk(atk);
         t.gameObject.SetActive(true);
     }
 }