Exemplo n.º 1
0
    IEnumerator BulletAttack()
    {
        canAttack = false;
        for (int i = 0; i < attackCount; i++)
        {
            if (gameObject.CompareTag("Unit") || gameObject.CompareTag("Player"))
            {
                BulletInfoSetting(ObjectManager.Call().GetObject("GreenBullet"));
            }
            else
            {
                BulletInfoSetting(ObjectManager.Call().GetObject("EnemyBullet"));
            }
            if (isChargeUnit)
            {
                animator.SetBool("Charge", true);
                Debug.Log("chargeb");
                yield return(new WaitForSeconds(chargeTime));

                Debug.Log("chargef");
                animator.SetBool("Charge", false);
                animator.SetBool("ChargeDone", true);
            }
            yield return(new WaitForSeconds(0.1f));
        }
    }
Exemplo n.º 2
0
 public void BulletFire()
 {
     if (!isShoot)
     {
         BulletInfoSetting(ObjectManager.Call().GetObject("WizardBullet"));
         isShoot = true;
     }
 }
Exemplo n.º 3
0
 IEnumerator GreenBulletAttack()
 {
     canShoot      = false;
     continuouFire = true;
     while (continuouFire)
     {
         cnt = 0;
         BulletInfoSetting(ObjectManager.Call().GetObject("GreenBullet"));
         yield return(new WaitUntil(() => cnt > AttackCooltime));
     }
 }
Exemplo n.º 4
0
    IEnumerator WhiteBulletShoot()
    {
        shotBulletCnt = 0;

        while (shotBulletCnt < bulletNum)
        {
            gapCnt = 0;

            BulletInfoSetting(ObjectManager.Call().GetObject("WhiteBullet"));
            shotBulletCnt++;

            yield return(new WaitUntil(() => gapCnt > bulletGapTime));
        }
    }
Exemplo n.º 5
0
    public void Down()
    {
        Debug.Log("Down 누름");
        // 슬롯에 아이템이 없으면 함수종료.
        if (!slot.isSlots())
        {
            Debug.Log("슬롯에 아이템이 없으면 함수종료");
            return;
        }


        // 처음 슬롯을 선택하는 경우.
        if (!checkClick)
        {
            checkClick = true;
            // 빈 이미지의 스프라이트를 슬롯의 스프라이트로 변경한다.
            //EmptyImg.sprite = slot.ItemReturn().DefaultImg;
            // 빈 이미지의 위치를 마우스위로 가져온다.
            //Img.transform.position = Input.mousePosition;
        }

        // 슬롯을 두 번째 선택하는 경우 Swap
        else if (checkClick)
        {
            // isSlots플래그가 false이면 슬롯에 아이템이 존재하지 않는 것이므로 함수 종료.
            if (!slot.isSlots())
            {
                return;
            }

            Debug.Log("스왑함수 호출");
            Img.transform.position = Input.mousePosition;
            // 싱글톤을 이용해서 인벤토리의 스왑함수를 호출(현재 슬롯, 빈 이미지의 현재 위치.)
            ObjectManager.Call().unitSlots.Swap(slot, Img.transform.position);
            checkClick = false;
            //slot = null;
        }
    }