Exemple #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        spaceship = GetComponent<Spaceship> ();
        common = GetComponent<EnemyCommon>();
        enemy = GetComponent<Enemy>();
        common.Init();

        //SE関係
        audioSource = gameObject.GetComponent<AudioSource>();

        st = common.CreateShotPosition();
        st.position = st.position + new Vector3(0,-1.7f,0);
        st2 = common.CreateShotPosition();
        st2.position = st2.position + new Vector3(0,1.7f,0);

        pt = FindObjectOfType<Party>().transform;

        StartCoroutine("MoveStop");
        StartCoroutine("Magne");
        StartCoroutine("Move");
        int span = 0;
        while(true)
        {
            audioSource.PlayOneShot(shootSE1);
            if(span % 5 == 0){
                int range = 50;
                common.Shot(st,Random.Range(-range,range),3,2,BulletManager.BulletType.StarBullet);
                common.Shot(st2,180+Random.Range(-range,range),3,2,BulletManager.BulletType.StarBullet);
            }
            else{
                int range = 5;
                common.Shot(st,Random.Range(-range,range),2,Random.Range(3,6),BulletManager.BulletType.StarBullet);
                common.Shot(st2,180+Random.Range(-range,range),2,Random.Range(3,6),BulletManager.BulletType.StarBullet);
            }
            ++span;
            yield return new WaitForSeconds(0.05f);
        }

        yield return null;
    }
Exemple #2
0
    IEnumerator Start()
    {
        spaceship = GetComponent<Spaceship> ();
        common = GetComponent<EnemyCommon>();
        common.Init();

        Transform s1 = common.CreateShotPosition();

        //SE関係
        audioSource = gameObject.GetComponent<AudioSource>();
        audioSource.clip = shootSE;
        //

        yield return new WaitForEndOfFrame();
        while (true)
        {
            audioSource.PlayOneShot(shootSE);
            common.Shot(s1, 0+30, power, speed, BulletManager.BulletType.BlossomBullet);
            common.Shot(s1, 60 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
            common.Shot(s1, 120 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
            common.Shot(s1, 180 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
            common.Shot(s1, 240 + 30, power, speed, BulletManager.BulletType.BlossomBullet);
            common.Shot(s1, 300 + 30, power, speed, BulletManager.BulletType.BlossomBullet);

            yield return new WaitForSeconds(spaceship.shotDelay);
        }
    }
Exemple #3
0
    IEnumerator Start()
    {
        spaceship = GetComponent<Spaceship> ();
        common = GetComponent<EnemyCommon>();
        common.Init();

        shootSESource = gameObject.GetComponent<AudioSource>();
        shootSESource.clip = shootSE;

        Transform s1 = common.CreateShotPosition();

        yield return new WaitForEndOfFrame();
        while (true)
        {
            common.Shot(s1, 60 + Random.Range(0, 60), power, 1, BulletManager.BulletType.SlimeBullet);
            shootSESource.PlayOneShot(shootSE);

            yield return new WaitForSeconds(spaceship.shotDelay);
        }
    }