コード例 #1
0
 public void OnFingerDown(Lean.LeanFinger finger)
 {
     if (finger.WhatTouched() != null)
     {
         TouchedElement = finger.WhatTouched();
     }
     // deeerp
 }
コード例 #2
0
ファイル: InputHandler.cs プロジェクト: yosuke-horiuchi/study
            /// <summary>
            /// タップのハンドラー
            /// </summary>
            /// <param name="finger"></param>
            public void OnFingerTap(Lean.LeanFinger finger)
            {
                UnitManager.RequestTap();
#if DEBUG_BUILD
                string s = " ○ タップ";
                Debug.Log(s);
                debugText.text = s;
#endif
            }
コード例 #3
0
ファイル: InputHandler.cs プロジェクト: yosuke-horiuchi/study
            /// <summary>
            /// スワイプのハンドラー
            /// </summary>
            /// <param name="finger"></param>
            public void OnFingerSwipe(Lean.LeanFinger finger)
            {
#if DEBUG_BUILD
                var s = default(string);
#endif
                if (UnitManager.Instance == null)
                {
                    return;
                }

                var swipe = finger.SwipeDelta;

                if (swipe.y > Mathf.Abs(swipe.x))
                {
                    UnitManager.RequestMovePlayerCharacter(MoveDirection.Front);
#if DEBUG_BUILD
                    s = " ↑ 上スワイプ";
#endif
                }

                if (swipe.y < -Mathf.Abs(swipe.x))
                {
                    UnitManager.RequestMovePlayerCharacter(MoveDirection.Back);
#if DEBUG_BUILD
                    s = " ↓ 下スワイプ";
#endif
                }

                if (swipe.x < -Mathf.Abs(swipe.y))
                {
                    UnitManager.RequestMovePlayerCharacter(MoveDirection.Left);
#if DEBUG_BUILD
                    s = " ← 左スワイプ";
#endif
                }

                if (swipe.x > Mathf.Abs(swipe.y))
                {
                    UnitManager.RequestMovePlayerCharacter(MoveDirection.Right);
#if DEBUG_BUILD
                    s = " → 右スワイプ";
#endif
                }

#if DEBUG_BUILD
                Debug.Log(s);
                debugText.text = s;
#endif
            }
コード例 #4
0
 public void OnFingerUp(Lean.LeanFinger finger)
 {
     TouchedElement = null;
     Capi.set("Camera.Rotation.x", transform.rotation.x);
     Capi.set("Camera.Rotation.y", transform.parent.rotation.y);
 }