コード例 #1
0
ファイル: Enemy.cs プロジェクト: Asta252/AoiFryte
    // Update is called once per frame
    IEnumerator _Update1()
    {
        while (true)
        {
            yield return(new WaitForSeconds(2.0f));

            float dir = GetAim();
            Bullet.Add(X, Y, dir, 3);
        }
    }
コード例 #2
0
    /// 更新
    IEnumerator _Update1()
    {
        while (true)
        {
            // 2秒おきに弾を撃つ
            yield return(new WaitForSeconds(2.0f));

            // 狙い撃ち角度を取得
            float dir = GetAim();
            Bullet.Add(X, Y, dir, 2);
        }
    }
コード例 #3
0
    IEnumerator _Update2()
    {
        // 発射角度を回転しながら撃つ
        yield return(new WaitForSeconds(2.0f));

        float dir = 0;

        while (true)
        {
            Bullet.Add(X, Y, dir, 2);
            dir += 16;
            yield return(new WaitForSeconds(0.1f));
        }
    }
コード例 #4
0
 /// 弾を発射する
 void DoBullet(float direction, float speed)
 {
     Bullet.Add(X, Y, direction, speed);
 }