public override void Interact() { GetComponent <DMovementExecutor>().enabled = false; DGamePauser.waitingForReleaseMovementGameObject = this.gameObject; DGameSystem.player.GetComponent <DMovement>().FaceToGameObject(this.gameObject); dialogs = new DScriptDialog[3]; for (int i = 0; i < dialogs.Length; i++) { dialogs[i] = new DScriptDialog(); } dialogs[0].sentences = new List <string> { "This is Script 1, sentensce 1", "THIS IS SEN2 ", "THIS IS SEN 3" }; dialogs[1].sentences = new List <string> { "This is Script 1, sentensce 1", "THIS IS SEN2 ", "THIS IS SEN 3" }; dialogs[2].sentences = new List <string> { "This is Script 1, sentensce 1", "THIS IS SEN2 ", "THIS IS SEN 3" }; DGamePauser.StartScripts(dialogs); }
public IEnumerator WildPokemonAppear() { rb2d.velocity = Vector2.zero; GetComponent <DControlByJoystick>().enabled = false; GameObject effect = DGameSystem.LoadPool("BlackScreenEffect", transform.position); effect.transform.SetParent(DGameSystem.cameraMain.transform); yield return(new WaitForSeconds(2)); //DGameSystem.SwitchControlToPokemon(); DGameSystem.pokemonControl.SetActive(true); DGameSystem.cameraScript.MoveTo(DGameSystem.pokemonEnemy.transform); DGameSystem.cameraScript.target = DGameSystem.pokemonEnemy; DScriptDialog dialog = new DScriptDialog(); dialog.sentences = new List <string> { "A wild pokemon appeared!" }; DGamePauser.StartScripts(new DScriptDialog[] { dialog }); yield return(new WaitForSeconds(2)); dialog = new DScriptDialog(); dialog.sentences = new List <string> { "Go my pokemon!" }; DGamePauser.StartScripts(new DScriptDialog[] { dialog }); DGameSystem.cameraScript.target = DGameSystem.pokemonControl; yield return(new WaitForSeconds(1)); DGamePauser.state = DGamePauser.STATE.FREE; }