void storyEvent() { if (StatusScript.story == 1) { PlayerScript.changeMode(2); UAnimator.SetBool("move", false); // キャラクターたちをバトルフィールドに移動させる playerPosition = unitychan.transform.position; playerRotation = unitychan.transform.eulerAngles; enemyPosition = this.transform.position; enemychan.transform.position = new Vector3(-84.48f, -0.45f, 76.04f); unitychan.transform.position = new Vector3(-82.337f, -0.531f, 74.65f); enemychan.transform.LookAt(unitychan.transform.position); unitychan.transform.LookAt(enemychan.gameObject.transform.position); /*BattleCamera2.enabled = true; * BattleCamera.enabled = false;*/ CaveCameraScript.CameraChange("Battle", "Main"); // 対戦モンスターの名前を取得し、バトルスクリプトを呼び出す chuboss = true; GameObject.Find("BattleText").GetComponent <CaveBattleMenuScript> ().enabled = true; GameObject.Find("BattleMenu").GetComponent <CaveBattleScript> ().enabled = true; } else if (StatusScript.story == 2) { chuboss = false; } }
void OnCollisionEnter(Collision other) { if ((PlayerScript.mode == 0 || PlayerScript.mode == 4) && !run_rag) { if (other.gameObject.name == "unitychan") { caution = false; Mark.GetComponent <Canvas> ().enabled = false; Mark2.GetComponent <Canvas> ().enabled = false; PlayerScript.changeMode(2); myAnimator.SetBool("move", false); // バトルフィールドを見えるようにする // キャラクターたちをバトルフィールドに移動させる playerPosition = unitychan.transform.position; playerRotation = unitychan.transform.eulerAngles; enemyPosition = this.transform.position; this.transform.position = new Vector3(-84.48f, -0.45f, 76.04f); unitychan.transform.position = new Vector3(-82.337f, -0.531f, 74.65f); transform.LookAt(player); unitychan.transform.LookAt(this.gameObject.transform); /*BattleCamera2.enabled = true; * BattleCamera.enabled = false;*/ CaveCameraScript.CameraChange("Battle", "Main"); // 対戦モンスターの名前を取得し、バトルスクリプトを呼び出す battleMonster = this.gameObject.name; GameObject.Find("BattleText").GetComponent <CaveBattleMenuScript> ().enabled = true; GameObject.Find("BattleMenu").GetComponent <CaveBattleScript> ().enabled = true; } } }