public IEnumerator skill1_bullet(int pNum)
 {
     while (count < 6)
     {
         count++;
         FavoriteFunction.BulletInstantiate(skill1_Bullet, pNum, transform);
         yield return(new WaitForSeconds(continue_bullet));
     }
     count = 0;
 }
 // Update is called once per frame
 void Update()
 {
     ShootBullet();
     deltaDistance = Vector3.Distance(start_position, transform.position);
     if (deltaDistance > 10f)
     {
         FavoriteFunction.BulletInstantiate(skill3_bullet, pNum_Bullet, transform);
         Destroy(gameObject);
     }
 }
 IEnumerator Create_Bullet()
 {
     while (true)
     {
         created_bullet.GetComponent <Diana_skill1_created_bullet>().directionVector = create_bullet_vector1; //방향 선정
         FavoriteFunction.BulletInstantiate(created_bullet, pNum_Bullet, transform);                          // 총알 생성
         created_bullet.GetComponent <Diana_skill1_created_bullet>().directionVector = create_bullet_vector2;
         FavoriteFunction.BulletInstantiate(created_bullet, pNum_Bullet, transform);
         yield return(new WaitForSeconds(reload_bullet_time));            //총알이 퍼질때의 간격
     }
 }
Example #4
0
    public override IEnumerator NomalAttack()
    {
        yield return(new WaitForSeconds(1f));

        while (true)
        {
            FavoriteFunction.BulletInstantiate(nomalBullet, pNum, transform);

            yield return(new WaitForSeconds(1f));
        }
    }
    public virtual IEnumerator NomalAttack()
    {
        yield return(new WaitForSeconds(1f));

        while (true)
        {
            if (nomalBullet != null)
            {
                FavoriteFunction.BulletInstantiate(nomalBullet, pNum, transform);
            }

            yield return(new WaitForSeconds(1f));
        }
    }
Example #6
0
    protected void division()
    {
        float angle;

        angle = Random.Range(-20f, 20f);
        skill3_bullet.GetComponent <Diana_skill3_child>().directionVector = new Vector3(directionVector.x * Mathf.Cos(angle * Mathf.Deg2Rad), Mathf.Sin(angle * Mathf.Deg2Rad), 0f);
        FavoriteFunction.BulletInstantiate(skill3_bullet, pNum_Bullet, transform);
        angle = Random.Range(20f, 60f);
        Debug.Log(angle);
        skill3_bullet.GetComponent <Diana_skill3_child> ().directionVector = new Vector3(directionVector.x * Mathf.Cos(angle * Mathf.Deg2Rad), Mathf.Sin(angle * Mathf.Deg2Rad), 0f);
        FavoriteFunction.BulletInstantiate(skill3_bullet, pNum_Bullet, transform);
        angle = Random.Range(-60f, -20f);
        skill3_bullet.GetComponent <Diana_skill3_child> ().directionVector = new Vector3(directionVector.x * Mathf.Cos(angle * Mathf.Deg2Rad), Mathf.Sin(angle * Mathf.Deg2Rad), 0f);
        FavoriteFunction.BulletInstantiate(skill3_bullet, pNum_Bullet, transform);
    }
    IEnumerator CreateTigerMoth(Transform myTransform, int pNum)
    {
        GameObject tigerMoth_Temp;

        tigerMoth_Temp = FavoriteFunction.BulletInstantiate(tigerMoth, pNum, myTransform);
        tigerMoth_Temp.GetComponent <Bullet_IrisMoth>().mothBullet = tigerMothBullet;

        yield return(new WaitForSeconds(0.5f));

        tigerMoth_Temp = FavoriteFunction.BulletInstantiate(tigerMoth, pNum, myTransform);
        tigerMoth_Temp.GetComponent <Bullet_IrisMoth>().mothBullet = tigerMothBullet;

        yield return(new WaitForSeconds(0.5f));

        tigerMoth_Temp = FavoriteFunction.BulletInstantiate(tigerMoth, pNum, myTransform);
        tigerMoth_Temp.GetComponent <Bullet_IrisMoth>().mothBullet = tigerMothBullet;
    }
    public override IEnumerator NomalAttack()
    {
        yield return(new WaitForSeconds(1f));

        while (true)
        {
            if (bullet_count == 0)
            {
                probablity = Random.Range(0f, 100f);
                if (probablity < 70f)
                {
                    yield return(new WaitForSeconds(1.2f));

                    bullet_count = bullet_max;
                }
                else
                {
                    yield return(new WaitForSeconds(0.6f));

                    bullet_count = bullet_max;                    // 크리티컬 터짐 + 앞으로 임펙트 추가해야함
                }
            }
            else
            {
                if (skill1_start == true)
                {
                    skill1_start = false;
                    Debug.Log(skill1_start);
                    yield return(StartCoroutine(gameObject.GetComponent <Diana_skill1>().skill1_bullet(pNum)));

                    bullet_count = 0;
                }
                else
                {
                    FavoriteFunction.BulletInstantiate(nomalBullet, pNum, transform);
                    bullet_count--;
                    yield return(new WaitForSeconds(0.2f));
                }
            }
        }
    }
 protected override void skill3()
 {
     FavoriteFunction.BulletInstantiate(skill3_bullet_parent, pNum, transform);
 }