Esempio n. 1
0
        public override bool OnClick(TouchEvent touch, UISound uiSound)
        {
            switch (touch.Listener.name)
            {
            case "ButtonCenter": {
                Debug.Log("SceneA: " + UIController.Instance.HasUIBase("Sample19Scene"));
                Debug.Log("SceneB: " + UIController.Instance.HasUIBase("Sample19SceneB"));
                Debug.Log("SceneC: " + UIController.Instance.HasUIBase("Sample19SceneC"));
                Debug.Log("SceneFront: " + UIController.Instance.GetFrontUINameInGroup(EnumUIGroup.Scene));
                Debug.Log("FloaterFront: " + UIController.Instance.GetFrontUINameInGroup(EnumUIGroup.Floater));
                Debug.Log("SystemFront: " + UIController.Instance.GetFrontUINameInGroup(EnumUIGroup.System));
                Debug.Log("SceneNum: " + UIController.Instance.GetLayerCountInGroup(EnumUIGroup.Scene));
                Debug.Log("FloaterNum: " + UIController.Instance.GetLayerCountInGroup(EnumUIGroup.Floater));
                Debug.Log("SystemNum: " + UIController.Instance.GetLayerCountInGroup(EnumUIGroup.System));
                return(true);
            }

            default: {
                return(false);
            }
            }
        }
Esempio n. 2
0
 public override bool OnDrop(TouchEvent touch)
 {
     m_ActionDrop?.Invoke(touch.Pointer);
     return(false);
 }
Esempio n. 3
0
 public override bool OnEndDrag(TouchEvent touch)
 {
     m_ActionEndDrag?.Invoke(touch.Pointer);
     return(false);
 }
Esempio n. 4
0
 public override bool OnBeginDrag(TouchEvent touch)
 {
     m_ActionBeginDrag?.Invoke(touch.Pointer);
     return(true);
 }
Esempio n. 5
0
 // ドロップ
 public virtual bool OnDrop(TouchEvent touch)
 {
     return(false);
 }
Esempio n. 6
0
 // タッチ開始
 public virtual bool OnTouchDown(TouchEvent touch)
 {
     return(false);
 }
Esempio n. 7
0
 // ドラッグ終了
 public virtual bool OnEndDrag(TouchEvent touch)
 {
     return(false);
 }
Esempio n. 8
0
 public override bool OnTouchDown(TouchEvent touch)
 {
     m_ButtonObject?.PointerDown(touch.Pointer);
     return(false);
 }
Esempio n. 9
0
 // クリック
 public virtual bool OnClick(TouchEvent touch, UISound uiSound)
 {
     // return Trueを返した段階で、他のOnClickは発火しない
     // base.OnClickを呼ぶ必要はない
     return(false);
 }
Esempio n. 10
0
 public override bool OnTouchUp(TouchEvent touch)
 {
     m_ButtonObject?.PointerUp(touch.Pointer);
     // Trueにするとそこで止まってOnClickが呼ばれなくなる
     return(false);
 }
Esempio n. 11
0
 // private void InitRootTransform()
 // {
 //     // UIPartの追加先を決定する
 //     Transform layer = m_TargetLayer.RootTransform.Find("Layer");
 //     RootTransform.SetParent(layer);
 //     // RootTransform.localPosition = new Vector3(0, -400, 0);
 //     RootTransform.localScale = Vector3.one;
 // }
 public override bool OnClick(TouchEvent touch, UISound uiSound)
 {
     m_ActionClick?.Invoke();
     return(true);
 }
Esempio n. 12
0
        public void CallTouchEvents(int untouchableIndex, bool isScreenTouchable, ISounder sounder)
        {
            while (m_TouchEvents.Count > 0)
            {
                TouchEvent touch = m_TouchEvents.Dequeue();

                if (!CheckTouchable(untouchableIndex, isScreenTouchable, touch))
                {
                    continue;
                }

                bool ret = false;

                // Trueが帰ってきたらTargetLayerにも伝播
                // 一旦無し
                switch (touch.Type)
                {
                case EnumTouchType.Click:
                    ret = OnClick(sounder, touch);
                    break;

                case EnumTouchType.Down:
                    ret = touch.Listener.Part.OnTouchDown(touch);
                    // if (ret) touch.Listener.Part.TargetLayer?.OnTouchDown(touch);
                    break;

                case EnumTouchType.Up:
                    ret = touch.Listener.Part.OnTouchUp(touch);
                    // if (ret) touch.Listener.Part.TargetLayer?.OnTouchUp(touch);
                    break;

                case EnumTouchType.Drag:
                    ret = touch.Listener.Part.OnDrag(touch);
                    // if (ret) touch.Listener.Part.TargetLayer?.OnDrag(touch);
                    break;

                case EnumTouchType.BeginDrag:
                    ret = touch.Listener.Part.OnBeginDrag(touch);
                    // if (ret) touch.Listener.Part.TargetLayer?.OnBeginDrag(touch);
                    break;

                case EnumTouchType.EndDrag:
                    ret = touch.Listener.Part.OnEndDrag(touch);
                    // if (ret) touch.Listener.Part.TargetLayer?.OnEndDrag(touch);
                    break;

                case EnumTouchType.Drop:
                    ret = touch.Listener.Part.OnDrop(touch);
                    // if (ret) touch.Listener.Part.TargetLayer?.OnDrop(touch);
                    break;

                case EnumTouchType.None:
                    break;

                default: break;
                }

                if (!ret)
                {
                    continue;
                }

                m_TouchEvents.Clear();
                break;
            }
        }
Esempio n. 13
0
        private static bool CheckTouchable(int untouchableIndex, bool isScreenTouchable, TouchEvent touch)
        {
            if (touch.Listener.Layer == null)
            {
                return(false);
            }

            return(isScreenTouchable &&
                   touch.Listener.Layer.IsTouchable() &&
                   untouchableIndex < touch.Listener.Layer.SiblingIndex);
        }
Esempio n. 14
0
 public override bool OnClick(TouchEvent touch, UISound uiSound)
 {
     UIController.Instance.Back();
     return(true);
 }