public void OnFingerDown(Lean.LeanFinger finger) { if (finger.WhatTouched() != null) { TouchedElement = finger.WhatTouched(); } // deeerp }
/// <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 }
/// <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 }
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); }