Esempio n. 1
0
    // 弾幕
    private void Func00()
    {
        if (frameCount % 2 == 0)
        {
            // 弾の生成
            for (int x = 0; x < 6; x++)
            {
                for (int y = 0; y < 3; y++)
                {
                    BulletWebGL targetBullet = FindBullet();
                    if (targetBullet == null)
                    {
                        continue;
                    }

                    // ----- ここから弾幕の設定 -----

                    // 初期座標
                    targetBullet.TransformCache.position = this.transformComponent.position;

                    // 初期速度
                    targetBullet.speed = 0.05f;

                    // 初期角度
                    targetBullet.Angle1 = 6.28f / 6 * (x + y / 7.0f) + frameCount * frameCount / 10000.0f;
                    targetBullet.Angle2 = 6.28f / 3 * y + Mathf.Sin(frameCount / 100f * y) / 12.0f;

                    // 色設定
                    targetBullet.SetColor(Color.HSVToRGB(
                                              (frameCount / 100.0f + x * 0.08f) % 1.0f,
                                              0.5f,
                                              0.6f));

                    // ----- 弾幕設定ここまで -----

                    targetBullet.Activate();
                }
            }
        }

        // 弾の移動処理
        // ここが一番重い
        BulletWebGL target;

        for (int i = 0; i < maxBullet; i++)
        {
            target = bulletList[i];
            if (target.active)
            {
                target.Move(); // 重い:要改善?
                this.pos = target.TransformCache.position;
                if (this.pos.x < -10 || this.pos.x > 10 || this.pos.y < -10 || this.pos.y > 10 || this.pos.z < -10 || this.pos.z > 10)
                {
                    target.Diactivate();
                }
            }
        }
    }
Esempio n. 2
0
 static public void BulletCreate(float px, float py, float pz, float speed, float angle1, float angle2, float h, float s, float v, float scale = 1)
 {
     bullet = FindBullet();
     if (bullet == null)
     {
         return;
     }
     SetSpeed(speed);
     bullet.TransformCache.position = new Vector3(px, py, pz);
     SetAngle1(angle1);
     SetAngle2(angle2);
     SetColor(h, s, v);
     SetState(1);
     SetScale(scale);
     SetTime(0);
     bullet.Activate();
 }
Esempio n. 3
0
    private void Func03()
    {
        this.lua.DoString(this.luaHeaderText + this.luaText);
        // BulletCreate (0, 0, 0, 0.05f, 0, 0, 0, 0.5f, 0.5f);

        // 弾の移動処理
        // ここが一番重い
        BulletWebGL target;

        for (int i = 0; i < maxBullet; i++)
        {
            target = bulletList[i];
            if (target.active)
            {
                target.Move(); // 重い:要改善?
                this.pos = target.TransformCache.position;
                if (this.pos.x < -10 || this.pos.x > 10 || this.pos.y < -10 || this.pos.y > 10 || this.pos.z < -10 || this.pos.z > 10)
                {
                    target.Diactivate();
                }
            }
        }

        return;

        if (frameCount % 3 == 0)
        {
            // 弾の生成
            for (int x = 0; x < 12; x++)
            {
                XCount = x;
                for (int y = 0; y < 3; y++)
                {
                    YCount = y;
                    bullet = FindBullet();
                    if (bullet == null)
                    {
                        continue;
                    }

                    // ----- ここから弾幕の設定 -----

                    // 初期座標
                    bullet.TransformCache.position = this.transformComponent.position;

                    // 初期速度
                    bullet.speed = 0.05f;

                    // this.lua = new LuaEnv ();
                    this.lua.DoString(this.luaScript.text);
                    // this.lua.DoString ("require 'test'");
                    // this.lua.Dispose ();

                    // 初期角度
                    // targetBullet.Angle1 = 6.28f / 6 * (x + y / 7.0f) + this.frameCount * this.frameCount / 10000.0f;
                    // targetBullet.Angle2 = 6.28f / 3 * y + Mathf.Sin (this.frameCount / 100f * y) / 12.0f;

                    // 色設定
                    // targetBullet.SetColor (Color.HSVToRGB (
                    //   (this.frameCount / 100.0f + x * 0.08f) % 1.0f,
                    //   0.5f,
                    //   0.6f));

                    // ----- 弾幕設定ここまで -----

                    bullet.Activate();
                }
            }
        }

        // 弾の移動処理
        // ここが一番重い
        for (int i = 0; i < maxBullet; i++)
        {
            target = bulletList[i];
            if (target.active)
            {
                target.Move(); // 重い:要改善?
                this.pos = target.TransformCache.position;
                if (this.pos.x < -10 || this.pos.x > 10 || this.pos.y < -10 || this.pos.y > 10 || this.pos.z < -10 || this.pos.z > 10)
                {
                    target.Diactivate();
                }
            }
        }
    }