private void Start() { if (cj == null) { cj = this; } else { Destroy(gameObject); } if (GetComponent <Image>() == null) { Debug.LogError("There is no joystick image attached to this script."); } if (transform.GetChild(0).GetComponent <Image>() == null) { Debug.LogError("There is no joystick handle image attached to this script."); } if (moveJoy) { moveJoy.Start(); } if (camJoy) { camJoy.Start(); } #region EventosEspecificosDoJogo_Start /* Eventos especificos do jogo */ //FayvitCommandReaderEventAgregator.AddListener(EventKey.startCheckPoint, OnStartCheckPoint); //FayvitCommandReaderEventAgregator.AddListener(EventKey.requestToFillDates, OnRequestFillDates); //FayvitCommandReaderEventAgregator.AddListener(EventKey.starterHudForTest, VerifiqueBtnDash); //FayvitCommandReaderEventAgregator.AddListener(EventKey.allAbilityOn, VerifiqueBtnDash); //FayvitCommandReaderEventAgregator.AddListener(EventKey.inicializaDisparaTexto, OnStartTalk); //FayvitCommandReaderEventAgregator.AddListener(EventKey.finalizaDisparaTexto, OnFinishTalk); #endregion FayvitCommandReaderEventAgregator.AddListener(FayvitCR_EventKey.requestHideControllers, OnRequestHideControlls); FayvitCommandReaderEventAgregator.AddListener(FayvitCR_EventKey.requestShowControllers, OnRequestShowControlls); FayvitCommandReaderEventAgregator.AddListener(FayvitCR_EventKey.changeHardwareController, OnChangeHardwareController); Debug.LogWarning("Interessante chamar o Evento changeHardwareController quando a cena for carregada"); // OnChangeHardwareController(new FayvitCommandReaderEvent(EventKey.changeHardwareController, GlobalController.g.Control)); }
private void OnDestroy() { FayvitCommandReaderEventAgregator.RemoveListener(FayvitCR_EventKey.requestHideControllers, OnRequestHideControlls); FayvitCommandReaderEventAgregator.RemoveListener(FayvitCR_EventKey.requestShowControllers, OnRequestShowControlls); FayvitCommandReaderEventAgregator.RemoveListener(FayvitCR_EventKey.changeHardwareController, OnChangeHardwareController); #region EventosEspecificosDoJogo_Destroy /* Eventos especificos do jogo */ //FayvitCommandReaderEventAgregator.RemoveListener(EventKey.inicializaDisparaTexto, OnStartTalk); //FayvitCommandReaderEventAgregator.RemoveListener(EventKey.finalizaDisparaTexto, OnFinishTalk); //FayvitCommandReaderEventAgregator.RemoveListener(EventKey.startCheckPoint, OnStartCheckPoint); //FayvitCommandReaderEventAgregator.RemoveListener(EventKey.requestToFillDates, OnRequestFillDates); //FayvitCommandReaderEventAgregator.RemoveListener(EventKey.starterHudForTest, VerifiqueBtnDash); //FayvitCommandReaderEventAgregator.RemoveListener(EventKey.allAbilityOn, VerifiqueBtnDash); #endregion }