// Use this for initialization void Start() { ssc = GameObject.Find("StaticScriptsOb").GetComponent <StaticScriptsCon>(); // 現在のマップ番号とレベルを保管 this.now_level = StaticScriptsCon.MapLevel(); this.now_map = StaticScriptsCon.MapNumber(); //Debug.Log("Map" + now_map + "Level" + now_level); // ベストスコアを保管 this.best_score = StaticScriptsCon.BestTime(now_map, now_level); // プレイヤーを初期位置に配置 GameObject StartFloor = GameObject.FindGameObjectWithTag("Start") as GameObject; GameObject Player = GameObject.FindGameObjectWithTag("Player") as GameObject; Player.transform.position = StartFloor.transform.position; Player.transform.position += new Vector3(0, 3.0f, 0); // ゴール判定処理の準備 this.goal_floor = GameObject.FindGameObjectWithTag("Goal"); this.goal_triger = this.goal_floor.GetComponent <GoalTriger>(); this.Start_Time[0] = new Vector3(0, 0, 0);//適当に作っとく // Map1 this.Start_Time[1] = new Vector3(300, 360, 480); // Map2 this.Start_Time[2] = new Vector3(420, 360, 300); // Map3 this.Start_Time[3] = new Vector3(420, 360, 300); // Map4 this.Start_Time[4] = new Vector3(420, 360, 300); // Map5 this.Start_Time[5] = new Vector3(420, 360, 300); // Map6 this.Start_Time[6] = new Vector3(420, 360, 300); // Map7 this.Start_Time[7] = new Vector3(420, 360, 300); switch (now_level) { case 1: this.game_time = this.Start_Time[now_map].x; break; case 2: this.game_time = this.Start_Time[now_map].y; break; case 3: this.game_time = this.Start_Time[now_map].z; break; } }
private int score; // スコア void Start() { // Rigidbody を取得 rb = GetComponent <CharacterController>(); // UI を初期化 score = 0; SetCountText(); map_level = StaticScriptsCon.MapLevel(); switch (map_level) { case 1: winText.text = "たからばこ を5個以上あつめて 外へ出よう!"; break; case 2: winText.text = "たからばこ を7個以上あつめて 外へ出よう!"; break; case 3: winText.text = "たからばこ を10個以上あつめて 外へ出よう!"; break; } }
// Use this for initialization void Start() { ssc = GameObject.Find("StaticScriptsOb").GetComponent <StaticScriptsCon>(); // 現在のマップ番号とレベルを保管 this.now_level = StaticScriptsCon.MapLevel(); this.now_map = StaticScriptsCon.MapNumber(); Debug.Log("Map" + now_map + "Level" + now_level); // ベストスコアを保管 this.best_score = StaticScriptsCon.BestTime(now_map, now_level); // プレイヤーを初期位置に配置 GameObject StartFloor1 = GameObject.Find("Start1") as GameObject; GameObject StartFloor2 = GameObject.Find("Start2") as GameObject; GameObject Player = GameObject.FindGameObjectWithTag("Player") as GameObject; if (sm == 0) { Player.transform.position = StartFloor1.transform.position; Player.transform.position += new Vector3(0, 3.0f, 0); sm = 1; } else { Player.transform.position = StartFloor2.transform.position; Player.transform.position += new Vector3(0, 3.0f, 0); Player.transform.Rotate(0, 180, 0); sm = 0; } // ゴール判定処理の準備 //this.goal_floor = GameObject.FindGameObjectWithTag("Goal"); //this.goal_triger = this.goal_floor.GetComponent<GoalTriger>(); this.Start_Time[0] = new Vector3(0, 0, 0);//適当に作っとく // Map1 this.Start_Time[1] = new Vector3(300, 360, 480); // Map2 this.Start_Time[2] = new Vector3(360, 300, 240); // Map3 this.Start_Time[3] = new Vector3(360, 300, 240); // Map4 this.Start_Time[4] = new Vector3(360, 300, 240); // Map5 this.Start_Time[5] = new Vector3(360, 300, 240); // Map6 this.Start_Time[6] = new Vector3(360, 300, 240); // Map7 this.Start_Time[7] = new Vector3(360, 300, 240); // switch (now_level) //{ // case 1: // this.game_time = this.Start_Time[now_map].x; // break; // case 2: // this.game_time = this.Start_Time[now_map].y; // break; //case 3: // this.game_time = this.Start_Time[now_map].z; // break; //} }