Exemple #1
0
        //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);
        }
Exemple #2
0
 void OnDestroy()
 {
     HiEvent.RemoveEventListener(HiEventID.GameClock_Start);
     HiEvent.RemoveEventListener(HiEventID.GameClock_Stop);
     stopwatch.Stop();
     stopwatch = null;
 }
Exemple #3
0
 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);
 }
Exemple #4
0
 void Awake()
 {
     HiEvent.AddEventListener <DG_Normal>(HiEventID.GameClock_Start, ClockStart);
     HiEvent.AddEventListener <DG_Normal>(HiEventID.GameClock_Stop, ClockStop);
     stopwatch = new Stopwatch();
     //ClockStop();
 }
Exemple #5
0
        //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>();
        }
Exemple #6
0
 /*
  * 아래 빌드관련 함수는 이벤트 인자값 전달을 가능하게 수정한 후에 이벤트 값을 받아서 처리하도록 수정해야함.
  */
 //버튼 하나 팝업 만들기
 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());
 }
Exemple #7
0
        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);
            }
        }
Exemple #8
0
 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);
     }
 }
Exemple #9
0
 void Update()
 {
     HiEvent.EventDispatch(HiEventID.Dim_Show_5);
 }
Exemple #10
0
        //void OnEnable()
        //{
        //	SetMessage(HiMessage.Instance.GetMessage_AdsOnLoad());
        //}

        void OnDisable()
        {
            HiEvent.EventDispatch(HiEventID.Dim_Hide);
        }
Exemple #11
0
 void OnEnable()
 {
     HiEvent.EventDispatch(HiEventID.Loading_Hide);
 }
Exemple #12
0
 void Awake()
 {
     updateCount = 200;
     targetImage = this.GetComponent <Image>();
     HiEvent.AddEventListener <DG_Normal>(HiEventID.CubeSelectFailure, OnCubeSelectFailure);
 }