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); }
void Start() { refObj0 = GameObject.Find("TIMEGUI0"); tmg0 = refObj0.GetComponent <TIMEGUI0>(); //コンポーネント refObj1 = GameObject.Find("TIMEGUI1"); tmg1 = refObj1.GetComponent <TIMEGUI1>(); //コンポーネント refObj3 = GameObject.Find("TIMEGUI3"); tmg3 = refObj3.GetComponent <TIMEGUI3>(); //コンポーネント refObj4 = GameObject.Find("TIMEGUI4"); tmg4 = refObj4.GetComponent <TIMEGUI4>(); //コンポーネント refObj6 = GameObject.Find("TIMEGUI6"); tmg6 = refObj6.GetComponent <TIMEGUI6>(); //コンポーネント refObj7 = GameObject.Find("TIMEGUI7"); tmg7 = refObj7.GetComponent <TIMEGUI7>(); //コンポーネント refObjf0 = GameObject.Find("FPS0"); fps0 = refObjf0.GetComponent <FPS0>(); //コンポーネント refObjf1 = GameObject.Find("FPS1"); fps1 = refObjf1.GetComponent <FPS1>(); //コンポーネント ucomp = GameObject.Find("ufo").GetComponent <Ufo>(); //ufo コンポーネント stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント alfa_time = 1.0f; alfa_fps = 1.0f; alfa_time_pa = 0.0f; alfa_fps_pa = 0.0f; cnt = 0; gage_time_sprite = GameObject.Find("gage_time").GetComponent <SpriteRenderer>(); }
void Start() { alfa_gage = 0.0f; ucomp = GameObject.Find("ufo").GetComponent <Ufo>(); //ufo コンポーネント stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント gage_pos = gameObject.transform.position + new Vector3(0.15f, 0.17f, -0.0001f); // プレハブからインスタンスを生成 for (int i = 0; i < 5; i++) { GameObject obj = (GameObject)Instantiate(prefab, gage_pos, Quaternion.identity); // 作成したオブジェクトを子として登録 obj.transform.parent = transform; obj.GetComponent <Yajirushi>().yajino = i; } //スコアの8桁 //スコアプレハブ生成 scoreobj = new GameObject[8]; for (int i = 0; i < 8; i++) { scoreobj[i] = Instantiate(scorefab, new Vector3(Const.CO.SCOREPOSX + 0.2f * i - 0.24f, Const.CO.SCOREPOSY, -0.0303f), Quaternion.identity); scoreobj[i].transform.parent = transform; } //スコアワード GameObject obj_scoreword = Instantiate(prefab_scoreword, new Vector3(-3.76f, -4.12f, -0.0303f), Quaternion.identity); obj_scoreword.transform.parent = transform;// 作成したオブジェクトを子として登録 }
// Use this for initialization void Start() { ucomp = GameObject.Find("ufo").GetComponent <Ufo>(); //ufo コンポーネント stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント SE = GameObject.Find("SE").GetComponent <SoundEffects>(); //コンポーネント objpos = transform.position; objpos.x = objpos.x * Const.CO.WY * 0.1f + 0.5f * Const.CO.WX; objpos.y = -(objpos.y * Const.CO.WY * 0.1f - 0.5f * Const.CO.WY); }
void Start() { audioSource = gameObject.GetComponent <AudioSource>(); audioSource.clip = audioClip[0]; stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>();//コンポーネント now_frame_audioClip_no = -1; pre_frame_audioClip_no = -1; stagesAudio = new int[19] { 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5 }; }
// 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関係 }
// Use this for initialization public void Start() { refObjUfo = GameObject.Find("ufo"); ucomp = refObjUfo.GetComponent <Ufo>(); //ufo コンポーネント stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント SE = GameObject.Find("SE").GetComponent <SoundEffects>(); //コンポーネント cnt = 0; goalflg = Const.CO.GOALWAIT; scoreprefabflg = 0; alfa = 1.0f; GetComponent <SpriteRenderer>().material.SetVector("_Intensity", new Color(1.0f * alfa, 0.7f * alfa, 0.7f * alfa, 1.0f)); }
// Use this for initialization void Start() { stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント SE = GameObject.Find("SE").GetComponent <SoundEffects>(); //コンポーネント index = 0; cnt = -30; //バックの半透明のやつ back = Instantiate(onespritefab, new Vector3(0f, 0f, -0.4f), Quaternion.identity); backcomp = back.GetComponent <OneSprite>(); backcomp.Create(1, 0, 0, 1300, 923); backcomp.SetScaleF3(new Vector3(0.0f, 0.93f, 1.0f)); SE.aS.PlayOneShot(SE.sscore0); }
// Use this for initialization void Start() { //ufo_count = 0;//UFOの流体側の当たり判定の、あたりにあたる領域の数 ufo_spd.x = 0.00f; ufo_spd.y = 0.00f; ufo_pos.x = 23.0f; //これは流体基準の座標 ufo_pos.y = 43.0f; //これは流体基準の座標 ufo_pos.z = -0.02f; ufo_restart_pos.x = ufo_pos.x; ufo_restart_pos.y = ufo_pos.y; ufo_rad = 0.0f; ufo_radspd = 0.0f; grav = 0.00f; jumpf = 0.0015f; //ジャンプキーを押したときのufoの進み具合 pullf = 0.0f; //流れの影響 hidamage = 0; forcetoufolimit = 0.0f; //ufoが受ける外力の最大値 hitpoint = 128.0f; fastkey = 0; //ufo当たり判定用画像load LoadUfoData();//bmpからload生成 ///////こっからはノズル //nozzle_count = 0;//ノズルの当たり判定の、あたりにあたる領域の数 nozzle_spd.x = 0.00f; nozzle_spd.y = 0.00f; nozzle_pos.x = 11.0f; //これは流体基準の座標 nozzle_pos.y = 11.0f; //これは流体基準の座標 nozzle_pos.z = -0.02f; nozzle_rys_pos.x = 0.00f; //これはノズルの粒子がでてくる座標を記憶する変数GPUでも同じ計算をしている nozzle_rys_pos.y = 0.00f; //これはノズルの粒子がでてくる座標を記憶する変数GPUでも同じ計算をしている LoadNozzleData(); //ノズルデータ生成 //こっからは見た目上の当たり判定 ufocoli_count = 0; LoadUfoColi();//当たり判定データload生成 //コンポーネント mnybllts = GameObject.Find("nabie").GetComponent <MenyBullets>(); // stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント SE = GameObject.Find("SE").GetComponent <SoundEffects>(); //コンポーネント cnt = 0; setcnt4 = 0; downkey = 0; p_downkey = 0; deathcounter = 0; }
// Use this for initialization void Start() { refObjScoreGUI = GameObject.Find("ScoreGUI"); scrguitexcomp = refObjScoreGUI.GetComponent <ScoreGUITexture>(); //コンポーネント stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント cnt = 0; diff = 0; tex = scrguitexcomp.normaltex; //Texture2DからSpriteを作成 sprite = Sprite.Create( texture: tex, rect: new Rect(0, (2 - stgmngrcomp.difficulty) * 33, 192, 33), pivot: new Vector2(0.5f, 0.5f) ); GetComponent <SpriteRenderer>().sprite = sprite; }
// Update is called once per frame void Update() { if (cnt == 0) { stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント moyasprite = GameObject.Find("moyasheet").GetComponent <SpriteRenderer>(); //コンポーネント backsprite = GameObject.Find("Backname").GetComponent <SpriteRenderer>(); //コンポーネント mymysprite = GetComponent <SpriteRenderer>(); } alfa = Mathf.Clamp(0.03f * (88 - cnt), 0.0f, 1.0f); mymysprite.material.SetVector("_Intensity", new Color(1.0f, 0.9f, 0.91f, 1.0f * alfa)); moyasprite.material.SetVector("_Intensity", new Color(0.5f, 1.0f, 0.5f, 1.0f * alfa)); backsprite.material.SetVector("_Intensity", new Color(0.1f, 0.1f, 0.1f, 1.0f * alfa)); cnt++; if (cnt > 90) //stage更新 { Destroy(this.gameObject); //そのあとは自分は死ぬ。 } }
void Start() { stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); tex = new Texture2D(Const.CO.WX, Const.CO.WX, TextureFormat.RGBA32, false); //Texture2DからSpriteを作成 for (int i = 0; i < Const.CO.WX; i++) { for (int j = 0; j < Const.CO.WX; j++) { tex.SetPixel(i, j, new Color(0.0f, 0.0f, 0.0f, 0.0f)); } } tex.Apply(); sprite = Sprite.Create( texture: tex, rect: new Rect(0, 0, Const.CO.WX, Const.CO.WX), pivot: new Vector2(0.5f, 0.5f) ); GetComponent <SpriteRenderer>().sprite = sprite; cnt = 0; }
void Start() { stgmngrcomp = GameObject.Find("StageManager").GetComponent <Stagemanager>(); //コンポーネント moyasprite = GameObject.Find("moyasheet").GetComponent <SpriteRenderer>(); //コンポーネント backsprite = GameObject.Find("Backname").GetComponent <SpriteRenderer>(); //コンポーネント mymysprite = GetComponent <SpriteRenderer>(); //自分の画像生成スプライト設定 sprite = Sprite.Create( texture: tex, rect: new Rect(0, 1178 - (stgmngrcomp.nowstage * 62) - 62, 1024, 62), pivot: new Vector2(0.5f, 0.5f) ); mymysprite.sprite = sprite; //backの画像生成スプライト設定 sprite = Sprite.Create( texture: tex, rect: new Rect(0, 1178 - (stgmngrcomp.nowstage * 62) - 62, 1024, 62), pivot: new Vector2(0.5f, 0.5f) ); backsprite.sprite = sprite; cnt = 0; }