Ejemplo n.º 1
0
        public UnityEngine.Touch ToUnityTouch()
        {
            Native.Touch      t = this.ToNativeTouch();
            UnityEngine.Touch uT;

            IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(t));

            try
            {
                Marshal.StructureToPtr(t, pnt, false);
                uT = (UnityEngine.Touch)Marshal.PtrToStructure(pnt, typeof(UnityEngine.Touch));
            }
            finally
            {
                Marshal.FreeHGlobal(pnt);
            }

            return(uT);
        }
Ejemplo n.º 2
0
        Native.Touch ToNativeTouch()
        {
            TouchPhase p;

            switch (Status)
            {
            case TouchStatus.Began:
                p = TouchPhase.Began;
                break;

            case TouchStatus.Moved:
                p = TouchPhase.Moved;
                break;

            case TouchStatus.Ended:
                p = TouchPhase.Ended;
                break;

            case TouchStatus.Stationary:
                p = TouchPhase.Stationary;
                break;

            default:
                p = TouchPhase.Canceled;
                break;
            }

            Native.Touch t = new Native.Touch(
                TouchId,
                TouchPoint,
                RawPoint,
                DeltaDistance,
                DeltaTime,
                1,
                p
                );

            return(t);
        }
Ejemplo n.º 3
0
		Native.Touch ToNativeTouch()
		{
			TouchPhase p;
			switch (Status)
			{
			case TouchStatus.Began:
				p = TouchPhase.Began;
				break;
			case TouchStatus.Moved:
				p = TouchPhase.Moved;
				break;
			case TouchStatus.Ended:
				p = TouchPhase.Ended;
				break;
			case TouchStatus.Stationary:
				p = TouchPhase.Stationary;
				break;
			default:
				p = TouchPhase.Canceled;
				break;
			}
			
			Native.Touch t = new Native.Touch (	
				TouchId,
				TouchPoint,
			    RawPoint,
				DeltaDistance,
				DeltaTime,
				1,
				p
			);
			
			return t;
		}