Exemple #1
0
 //スペース押したときに噴射する赤いやつ
 void NozzleFire()
 {
     //VRAMの更新
     bulletsComputeShader.SetBuffer(kernelryuusi_fire, "RYS", dtprtcomp.RYS);
     bulletsComputeShader.SetFloat("OBJ0POSX", ucomp.nozzle_rys_pos.x);
     bulletsComputeShader.SetFloat("OBJ0POSY", ucomp.nozzle_rys_pos.y);
     bulletsComputeShader.SetInt("OFSET0", refer.NOZZLEPARTICLENUM);
     bulletsComputeShader.SetInt("OFSET1", dtprtcomp.RYS.count);
     bulletsComputeShader.SetInt("OFSET2", dtprtcomp.write_idx);
     bulletsComputeShader.SetInt("OFSET3", (int)((cnt) % 1234567) + UnityEngine.Random.Range(0, 423));//seed
     bulletsComputeShader.Dispatch(kernelryuusi_fire, (refer.NOZZLEPARTICLENUM + 63) / 64, 1, 1);
     //RYcの更新とindexの更新
     dtprtcomp.NozzleRYS(ucomp.nozzle_rys_pos.x - 1.0f, ucomp.nozzle_rys_pos.y - 1.0f, 2.0f, 2.0f);
 }