コード例 #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);
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     menybulletscomp = GetComponent <MenyBullets>();                                  //コンポーネント
     stgmngrcomp     = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント
     refer           = GameObject.Find("referobj").GetComponent <Referobj>();         //コンポーネント
     someofRYS       = new SomeofRYS(1);                                              //毎フレーム粒子が一部初期化されていくやつ
     write_idx       = 0;
     //someofRYSがインスタンス化できているのでload wallする
     GetComponent <LoadWallFromBMP>().LoadWallInfo2("0");
     cnt = 0;
     RYcmaker_start();//RYc関係
 }
コード例 #3
0
ファイル: SelectBox.cs プロジェクト: maze516/cfdgame
    // Update is called once per frame
    void Update()
    {
        //はじめから、つづきから、EXITの選択
        if (select_x_id < 3 && select_x_id >= 0)
        {
            if ((Input.GetAxis("Horizontal") < -0.8f))
            {
                buttondown_now = -1;
                if (buttondown_log != -1)
                {
                    select_x_id--;
                    SE.aS.PlayOneShot(SE.pi1);
                    if (select_x_id == -1)
                    {
                        select_x_id = 2;
                    }
                }
            }
            else
            {
                if ((Input.GetAxis("Horizontal") > 0.8f))
                {
                    buttondown_now = 1;
                    if (buttondown_log != 1)
                    {
                        select_x_id++;
                        SE.aS.PlayOneShot(SE.pi1);
                        if (select_x_id == 3)
                        {
                            select_x_id = 0;
                        }
                    }
                }
                else
                {
                    buttondown_now = 0;
                }
            }
        }



        //難易度の選択
        if (select_x_id < 6 && select_x_id >= 3)
        {
            if ((Input.GetAxis("Vertical") < -0.8f))
            {
                buttondown_now = -1;
                if (buttondown_log != -1)
                {
                    select_x_id++;
                    SE.aS.PlayOneShot(SE.pi1);
                    if (select_x_id == 6)
                    {
                        select_x_id = 5;
                        counter++;
                        if (counter == 100)//100回HARDから下を入力するとでーたが消える
                        {
                            SE.aS.PlayOneShot(SE.exp1);
                            PlayerPrefs.DeleteAll();
                        }
                    }
                }
            }
            else
            {
                if ((Input.GetAxis("Vertical") > 0.8f))
                {
                    buttondown_now = 1;
                    if (buttondown_log != 1)
                    {
                        select_x_id--;
                        SE.aS.PlayOneShot(SE.pi1);
                        if (select_x_id == 2)
                        {
                            select_x_id = 3;
                        }
                    }
                }
                else
                {
                    buttondown_now = 0;
                }
            }
        }



        //決定
        if (Input.GetButtonDown("Jump"))
        {
            //つづきから
            if (select_x_id == 1)
            {
                if (CheckData())
                {
                    SE.aS.PlayOneShot(SE.pi2);
                    select_x_id = 6;
                    GameObject obj = Instantiate(fadeOutfab, new Vector3(0f, 0f, -1.2f), Quaternion.identity);
                    fadeoutcomp = obj.GetComponent <TitleFadeOut>();//
                    flg         = 3;
                }
                else//セーブデータがないなら
                {
                    //ぶぶーの音ならす
                    SE.aS.PlayOneShot(SE.bubu);
                }
            }
            //EXIT
            if (select_x_id == 2)
            {
                SE.aS.PlayOneShot(SE.pi2);
                select_x_id = 6;
                GameObject obj = Instantiate(fadeOutfab, new Vector3(0f, 0f, -1.2f), Quaternion.identity);
                fadeoutcomp = obj.GetComponent <TitleFadeOut>();//
                flg         = 2;
            }

            //EASY
            if (select_x_id == 3)
            {
                SE.aS.PlayOneShot(SE.pi2);
                select_x_id = 6;
                GameObject obj = Instantiate(fadeOutfab, new Vector3(0f, 0f, -1.2f), Quaternion.identity);
                fadeoutcomp     = obj.GetComponent <TitleFadeOut>();                     //
                robj            = GameObject.Find("referobj").GetComponent <Referobj>(); //
                robj.difficulty = 0;
                flg             = 1;
            }
            //NORMAL
            if (select_x_id == 4)
            {
                SE.aS.PlayOneShot(SE.pi2);
                select_x_id = 6;
                GameObject obj = Instantiate(fadeOutfab, new Vector3(0f, 0f, -1.2f), Quaternion.identity);
                fadeoutcomp     = obj.GetComponent <TitleFadeOut>();                     //
                robj            = GameObject.Find("referobj").GetComponent <Referobj>(); //
                robj.difficulty = 1;
                flg             = 1;
            }
            //HARD
            if (select_x_id == 5)
            {
                SE.aS.PlayOneShot(SE.pi2);
                select_x_id = 6;
                GameObject obj = Instantiate(fadeOutfab, new Vector3(0f, 0f, -1.2f), Quaternion.identity);
                fadeoutcomp     = obj.GetComponent <TitleFadeOut>();                     //
                robj            = GameObject.Find("referobj").GetComponent <Referobj>(); //
                robj.difficulty = 2;
                flg             = 1;
            }

            //はじめから
            if (select_x_id == 0)
            {
                SE.aS.PlayOneShot(SE.pi2);
                gameobj_easy.SetActive(true);
                gameobj_norm.SetActive(true);
                gameobj_hard.SetActive(true);
                select_x_id = 4;
            }
        }



        //キャンセルボタンの時
        if (Input.GetButtonDown("Cancel"))
        {
            if (select_x_id < 6 && select_x_id >= 3)
            {
                SE.aS.PlayOneShot(SE.pi2);
                gameobj_easy.SetActive(false);
                gameobj_norm.SetActive(false);
                gameobj_hard.SetActive(false);
                select_x_id = 0;
            }
        }



        //flg = 2のときはEXIT終了
        if (flg == 2)
        {
            if (fadeoutcomp.cnt > 90)
            {
                Application.Quit();
            }
        }

        //flg = 1のときはシーン終了
        if (flg == 1)
        {
            if (fadeoutcomp.cnt > 90)
            {
                SceneManager.LoadScene("prorogue");
            }
        }

        //3のときはつづきから
        if (flg == 3)
        {
            if (fadeoutcomp.cnt > 90)
            {
                SceneManager.LoadScene("stageselect");
            }
        }

        buttondown_log = buttondown_now;
        setpos();
        cnt++;
    }