コード例 #1
0
    //public GameObject bullet;
    // Start is called before the first frame update
    IEnumerator Start()
    {
        spaceship = GetComponent <CommonSpaceship>();

        while (true)
        {
            spaceship.Shot(transform);

            //Instantiate(bullet, transform.position, transform.rotation);

            yield return(new WaitForSeconds(0.05f));
        }
    }
コード例 #2
0
    IEnumerator Start()
    {
        spaceship = GetComponent <CommonSpaceship>();

        spaceship.Move(transform.up * -1);

        while (true)
        {
            for (int i = 0; i < transform.childCount; i++)
            {
                Transform shotPosition = transform.GetChild(i);

                spaceship.Shot(shotPosition);
            }

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