public static GestureOperationStatus CreateGestureStatus(GestureOperation operation) { GestureOperationStatus s = new GestureOperationStatus(); s.mOperation = operation; return(s); }
/// <summary> /// Push a holding gesture operation command /// </summary> /// <param name="holdingPoint"></param> /// <param name="progressTime"></param> /// <param name="roundDistance"></param> /// <returns></returns> public GestureOperationStatus PushHoldingGestureCommand(Vector3 holdingPoint, float progressTime, float roundDistance) { var go = GestureOperation.CreateHoldingGestureCommand(holdingPoint, progressTime, roundDistance); go.id = idPool++; gestureOperations.Add(go); return(GestureOperationStatus.CreateGestureStatus(go)); }
/// <summary> /// Push a lining gesture operation command /// </summary> /// <param name="originPoint"></param> /// <param name="endPoint"></param> /// <param name="roundDistance"></param> /// <returns></returns> public GestureOperationStatus PushLiningGestureCommand(Vector3 originPoint, Vector3 endPoint, float roundDistance) { var go = GestureOperation.CreateLiningGestureCommand(originPoint, endPoint, roundDistance); go.id = idPool++; gestureOperations.Add(go); return(GestureOperationStatus.CreateGestureStatus(go)); }
void SetReadyToSlide() { if (gestureOperationStatus != null) { InputPlatform.Singleton.RemoveGestureCommand(gestureOperationStatus.id); gestureOperationStatus = null; } Vector3 startPosition = Camera.main.WorldToScreenPoint(slideStartPostion.position); Vector3 stopPosition = Camera.main.WorldToScreenPoint(slideStopPosition.position); startPosition.z = 0f; stopPosition.z = 0f; float roundDis = 100f / InputPlatform.Singleton.ScreenSizeRatio; gestureOperationStatus = InputPlatform.Singleton.PushLiningGestureCommand(startPosition, stopPosition, roundDis); }