Ejemplo n.º 1
0
    public float[] kkp;   //流体関連の圧力壁定義点のval

    void Start()
    {
        ucomp           = GameObject.Find("ufo").GetComponent <Ufo>();                   //ufo コンポーネント
        frntcomp        = GameObject.Find("frontpng").GetComponent <Frontstage>();       //コンポーネント
        dtprtcomp       = GetComponent <DotParticle>();                                  //コンポーネント
        stgmngrcomp     = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント
        SE              = GameObject.Find("SE").GetComponent <SoundEffects>();           //コンポーネント
        refer           = GameObject.Find("referobj").GetComponent <Referobj>();         //コンポーネント
        kbp             = new uint[Const.CO.WX * Const.CO.WY];
        kbpori          = new uint[Const.CO.WX * Const.CO.WY];
        kbx             = new uint[Const.CO.WX * Const.CO.WY];
        kby             = new uint[Const.CO.WX * Const.CO.WY];
        kkx             = new float[Const.CO.WX * Const.CO.WY];
        kky             = new float[Const.CO.WX * Const.CO.WY];
        kkp             = new float[Const.CO.WX * Const.CO.WY];
        res             = new int[108];
        bulletsMaterial = new Material(bulletsShader);
        Debug.Log(Mathf.Sqrt(Mathf.Clamp((65536f * 4f) / refer.PARTICLENUM, 0.0f, 1.0f)));
        bulletsMaterial.SetFloat("_Intensity", Mathf.Sqrt(Mathf.Clamp((65536f * 4f) / refer.PARTICLENUM, 0.0f, 1.0f)));
        FindKernelInit();          //
        InitializeComputeBuffer(); //ここで流体関連と粒子等のvram生成
        SetKernels();              //カーネル全部作成&引数セット
        //コマンドバッファ系
        commandb = new CommandBuffer();
        Camera cam = GameObject.Find("Main Camera").GetComponent <Camera>();//コンポーネント

        commandb.name = "gpu instanse";
        commandb.DrawProcedural(cam.cameraToWorldMatrix, bulletsMaterial, 0, MeshTopology.Points, dtprtcomp.RYS.count, 1);
        cam.AddCommandBuffer(CameraEvent.AfterForwardOpaque, commandb);

        GetComponent <LoadWallFromBMP>().stages_speed = 0.0f;
        GetComponent <LoadWallFromBMP>().LoadWallInfo("0");//ここで壁情報を画像データbmpやpngから読み込み壁情報をvramに転送
        cnt  = 0;
        extf = new Vector2(0.0f, 0.0f);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        ucomp        = GameObject.Find("ufo").GetComponent <Ufo>();               //ufo コンポーネント
        frntcomp     = GameObject.Find("frontpng").GetComponent <Frontstage>();   //コンポーネント
        bckcomp      = GameObject.Find("backpng").GetComponent <backstage>();     //コンポーネント
        dtprtcomp    = GameObject.Find("nabie").GetComponent <DotParticle>();     //コンポーネント
        ldwllinfcomp = GameObject.Find("nabie").GetComponent <LoadWallFromBMP>(); //コンポーネント
        mnybllts     = GameObject.Find("nabie").GetComponent <MenyBullets>();     //コンポーネント
        SS           = GameObject.Find("StageSound").GetComponent <StageSound>(); //コンポーネント
        SE           = GameObject.Find("SE").GetComponent <SoundEffects>();       //コンポーネント

        //nowstage = 0;//今遊んでるステージ
        nowstage         = GameObject.Find("referobj").GetComponent <Referobj>().nowstage; //シーン切り替えで引き継ぐ変数の受け渡し
        veryfaststageFlg = 1;
        stage_clear_flg  = 0;                                                              //クリア時にのみ1になる
        stage_score      = 0;
        keyflg           = 0;                                                              //キー操作を受け付けるかどうか、1受け付ける、0受け付けない。受け付けないときはufoの座標系さんもとまる
        fadeinflg        = 0;                                                              //フェードインカウンター、開始が0で毎フレーム1増えていく。fade in後操作をしばらく受け付けない
        //difficulty = 0;//0はイージー、1がノーマル、2がハード
        difficulty    = GameObject.Find("referobj").GetComponent <Referobj>().difficulty;  //シーン切り替えで引き継ぐ変数の受け渡し
        stagetime     = 0.0f;
        fadeoutObjflg = 0;

        //ゴール系
        glcomp     = new GoalWhite[4];                      //ゴール設定数最大4
        goalObj    = new GameObject[4];                     //ゴール設定数最大4
        goalnum    = 1;                                     //最初のステージだけここからインスタンス化
        goalObj[0] = Instantiate(goalprefab, new Vector3(1.0f * (96 - Const.CO.WX / 2) / (Const.CO.WY / 2) * 5.0f, 1.0f * (Const.CO.WY - 1 - 72 - Const.CO.WY / 2) / (Const.CO.WY / 2) * 5.0f, -0.02f), Quaternion.identity);
        glcomp[0]  = goalObj[0].GetComponent <GoalWhite>(); //ゴール0のスクリプトデータ取得

        //レアアース系
        rareenum = 0;
        rareeObj = new GameObject[6];//ゴール設定数最大6

        //浮遊obj系
        fobjnum = 0;
        objObj  = new GameObject[3];//浮遊obj設定数最大3
        mvocomp = new Moveobj[3];

        //最初のステージだけはここからインスタンス化、ステージ開始時のフェードイン
        Instantiate(startfab, new Vector3(0.0f, 0.0f, -0.5f), Quaternion.identity);
        //最初のステージだけはここからインスタンス化、ステージ開始時の文字
        Instantiate(stagenameprefab, new Vector3(1.6f, 0.0f, -0.032f), Quaternion.identity);

        //このスクリプトが最後に実行されるためこれが可能になる
        if (nowstage != 0)
        {
            nowstage--;
            stage_score = GameObject.Find("referobj").GetComponent <Referobj>().stage_score;//シーン切り替えで引き継ぐ変数の受け渡し
            stageclear();
        }
    }