//override protected void OnFirstEnable() //{ // base.OnFirstEnable(); // HiEvent.AddEventListener<DG_Objects>(HiEventID.Loading_Hide.ToString(), HideLoading); // HiEvent.AddEventListener<DG_Objects>(HiEventID.Loading_Show.ToString(), ShowLoading); //} override protected void Awake() { base.Awake(); HiEvent.AddEventListener <DG_Objects>(HiEventID.Loading_Hide, HideLoading); HiEvent.AddEventListener <DG_Objects>(HiEventID.Loading_Show, ShowLoading); this.gameObject.SetActive(false); }
void OnDestroy() { HiEvent.RemoveEventListener(HiEventID.GameClock_Start); HiEvent.RemoveEventListener(HiEventID.GameClock_Stop); stopwatch.Stop(); stopwatch = null; }
void Awake() { HiEvent.AddEventListener <DG_Normal>(HiEventID.Dim_Hide, HideDimPanel); HiEvent.AddEventListener <DG_Normal>(HiEventID.Dim_Show_0, ShowDimPanel0); HiEvent.AddEventListener <DG_Normal>(HiEventID.Dim_Show_5, ShowDimPanel5); this.gameObject.SetActive(false); }
void Awake() { HiEvent.AddEventListener <DG_Normal>(HiEventID.GameClock_Start, ClockStart); HiEvent.AddEventListener <DG_Normal>(HiEventID.GameClock_Stop, ClockStop); stopwatch = new Stopwatch(); //ClockStop(); }
//private DG_Normal CallbackFunction1; //private DG_Normal CallbackFunction2; override protected void Awake() { base.Awake(); HiEvent.AddEventListener <DG_Normal>(HiEventID.Popup_Hide, HidePopupPanel); HiEvent.AddEventListener <DG_Normal>(HiEventID.Popup_Show, ShowPopupPanel); this.gameObject.SetActive(false); button1Texts[0] = Button1_1.transform.GetChild(0).GetComponent <Text>(); button2Texts[0] = Button2_1.transform.GetChild(0).GetComponent <Text>(); button2Texts[1] = Button2_2.transform.GetChild(0).GetComponent <Text>(); }
/* * 아래 빌드관련 함수는 이벤트 인자값 전달을 가능하게 수정한 후에 이벤트 값을 받아서 처리하도록 수정해야함. */ //버튼 하나 팝업 만들기 public void BuildPopup(string _mainMsg, string _buttonTxt, Action _callback = null) { if (_callback == null) { _callback = delegate { HiEvent.EventDispatch(HiEventID.Popup_Hide); }; } MessageText.fontSize = 20; ButtonInit(); MessageText.text = _mainMsg; button1Texts[0].text = _buttonTxt; //CallbackFunction1 = fun; Button1_1.gameObject.SetActive(true); Button1_1.onClick.AddListener(() => _callback()); }
private void OnClick() { HiSound.Instance.PlayAudio_Sound(HiSound.SOUND.Click); int _index = EventIndex; if (_index >= 0 && _index < (int)HiEventBtnID.Max) { HiEvent.EventDispatch((HiEventBtnID)_index); } else { throw new System.Exception("Error ▶ HiButtonEvent > Unregistered button events. > index=" + _index); } }
private void TouchProcessMulti() { if (cpInput.GetTouchCount() != cpTouchCount) { cpTouchState = EnTouchActionState.None; return; } if (cpTouchState == EnTouchActionState.Fail) { return; } if (cpTouchState == EnTouchActionState.None) { if (Vector2.Distance(cpInput.GetTouch(0).position, cpInput.GetTouch(1).position) < cpTouchBoundary) { cpTouchState = EnTouchActionState.Down; cpTouch1Position = Vector2.LerpUnclamped(cpInput.GetTouch(0).position, cpInput.GetTouch(1).position, 0.5f); } else { cpTouchState = EnTouchActionState.Fail; return; } } if (cpTouchState == EnTouchActionState.Down) { cpTouch2Position = Vector2.LerpUnclamped(cpInput.GetTouch(0).position, cpInput.GetTouch(1).position, 0.5f); if (Vector2.Distance(cpTouch1Position, cpTouch2Position) > cpTouchBoundary) { cpTouch1Position = Vector2.LerpUnclamped(cpInput.GetTouch(0).position, cpInput.GetTouch(1).position, 0.5f); if (Mathf.Abs(cpTouch1Position.x - cpTouch2Position.x) >= Mathf.Abs(cpTouch1Position.y - cpTouch2Position.y)) { cpTouchState = EnTouchActionState.DragX; } else { cpTouchState = EnTouchActionState.DragY; } } } if (cpTouchState == EnTouchActionState.DragX || cpTouchState == EnTouchActionState.DragY) { this.transform.Rotate(new Vector3((cpTouch2Position.y - cpTouch1Position.y) / cpResistivity, (cpTouch1Position.x - cpTouch2Position.x) / cpResistivity, 0), Space.World); cpTouch1Position = cpTouch2Position; cpTouch2Position = Vector2.LerpUnclamped(cpInput.GetTouch(0).position, cpInput.GetTouch(1).position, 0.5f); HiEvent.EventDispatch(HiEventID.CubeRotation); } }
void Update() { HiEvent.EventDispatch(HiEventID.Dim_Show_5); }
//void OnEnable() //{ // SetMessage(HiMessage.Instance.GetMessage_AdsOnLoad()); //} void OnDisable() { HiEvent.EventDispatch(HiEventID.Dim_Hide); }
void OnEnable() { HiEvent.EventDispatch(HiEventID.Loading_Hide); }
void Awake() { updateCount = 200; targetImage = this.GetComponent <Image>(); HiEvent.AddEventListener <DG_Normal>(HiEventID.CubeSelectFailure, OnCubeSelectFailure); }