bool StartMove = false; //初期位置への移動が終わったどうか(false=移動中,true=移動終了) // Start is called before the first frame update void Start() { audio_script = GameObject.Find("Audio_Matome").GetComponent <Audio>(); Enemy_Dasu = GameObject.Find("Enemy_Syutugen").GetComponent <Enemy_Dasu>(); rigid = this.gameObject.GetComponent <Rigidbody2D>(); Player = GameObject.Find("Player"); //シーンがタイトルかタイムアタックだったら if (SceneManager.GetActiveScene().name.Equals("Title") == true || SceneManager.GetActiveScene().name.Equals("TimeAttack")) { Vector2 Scale = this.gameObject.transform.localScale; //scallを0.3増やす this.gameObject.transform.localScale = new Vector2(Scale.x + 0.3f, Scale.y + 0.3f); Shot_Point_Kyori += 0.2f; } if (this.gameObject.name.Contains("Elite") == true) //名前にEliteとついていたら { Elite = true; //強化版に設定 } Syokiiti = new Vector3(this.transform.position.x, 3.8f, 0); //初期位置を設定 Invoke("Hassya", 1); //1秒後に球を発射 }
bool GameEnd = false; //false=ゲームが始まっている,true=ゲームが終わっている // Start is called before the first frame update void Start() { canvas = GameObject.Find("Canvas"); if (SceneManager.GetActiveScene().name.Equals("ScoreAttack"))//今のシーンがスコアアタックなら { Now_ScoreAttack = true; //子要素のテキストのオブジェクトを取得 Score_Text = this.transform.Find("Score_Text").GetComponent <Text>(); HighScore_Text = this.transform.Find("HighScore_Text").GetComponent <Text>(); Life_Text = this.transform.Find("Life_Text").GetComponent <Text>(); Bomu_Text = this.transform.Find("Bomu_Text").GetComponent <Text>(); Life = Max_Life; //体力を最大値に設定 Bomu = Max_Bomu; //ボムの所持数を最大値に設定 HighScore = PlayerPrefs.GetInt("HighScore", 0); //最高得点をロード,データがなければ0を返す //テキストを変更 Hyouzi_Life(); Hyouzi_Bomu(); Hyouzi_Score(false); } else { High_Time = PlayerPrefs.GetFloat("HighTime", 0); Time_Text = this.transform.Find("Time_Text").GetComponent <Text>(); High_Time_Text = this.transform.Find("High_Time_Text").GetComponent <Text>(); Hyouzi_Time(false);//経過時間を表示 } Tama_Matome = GameObject.Find("Tama_Matome"); Enemy_Dasu = GameObject.Find("Enemy_Syutugen").GetComponent <Enemy_Dasu>(); Make_Wall = GameObject.Find("Kabe_Parent").GetComponent <Make_Wall>(); audio_script = GameObject.Find("Audio_Matome").GetComponent <Audio>(); }