コード例 #1
0
    static void AccelerationEvent_deltaTime(JSVCall vc)
    {
        UnityEngine.AccelerationEvent _this = (UnityEngine.AccelerationEvent)vc.csObj;
        var result = _this.deltaTime;

        JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
    }
コード例 #2
0
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.AccelerationEvent o;
         o = new UnityEngine.AccelerationEvent();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #3
0
// fields

// properties
    static void AccelerationEvent_acceleration(JSVCall vc)
    {
        UnityEngine.AccelerationEvent _this = (UnityEngine.AccelerationEvent)vc.csObj;
        var result = _this.acceleration;

        JSApi.setVector3S((int)JSApi.SetType.Rval, result);
    }
コード例 #4
0
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.AccelerationEvent o;
			o=new UnityEngine.AccelerationEvent();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
コード例 #5
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.AccelerationEvent o;
         o = new UnityEngine.AccelerationEvent();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #6
0
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.AccelerationEvent o;
         o=new UnityEngine.AccelerationEvent();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
コード例 #7
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.AccelerationEvent o;
         o = new UnityEngine.AccelerationEvent();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
コード例 #8
0
 static public int GetAccelerationEvent_s(IntPtr l)
 {
     try{
         System.Int32 a1;
         checkType(l, 1, out a1);
         UnityEngine.AccelerationEvent ret = UnityEngine.Input.GetAccelerationEvent(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
コード例 #9
0
 static int QPYX_GetAccelerationEvent_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         int QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 1);
         UnityEngine.AccelerationEvent QPYX_o_YXQP = UnityEngine.Input.GetAccelerationEvent(QPYX_arg0_YXQP);
         ToLua.PushValue(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
コード例 #10
0
 static int GetAccelerationEvent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         UnityEngine.AccelerationEvent o = UnityEngine.Input.GetAccelerationEvent(arg0);
         ToLua.PushValue(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #11
0
 public static int GetAccelerationEvent_wrap(long L)
 {
     try
     {
         int arg0 = FCLibHelper.fc_get_int(L, 0);
         UnityEngine.AccelerationEvent ret = UnityEngine.Input.GetAccelerationEvent(arg0);
         long ret_ptr = FCLibHelper.fc_get_return_ptr(L);
         long v       = FCGetObj.PushObj(ret);
         FCLibHelper.fc_set_value_wrap_objptr(ret_ptr, v);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
コード例 #12
0
ファイル: ShakeDetector.cs プロジェクト: fengqk/Art
	private void OnOneAccelerationEvent (AccelerationEvent e)
	{
		//清除超过 shakeTimeThreshold 的 AccelerationEvent
		Single totalTime = 0 + e.deltaTime;
		foreach (var oldEvent in m_eventQueue)
			totalTime += oldEvent.deltaTime;

		Single leftTotalTime = totalTime;
		while (leftTotalTime > m_shakeTimeThreshold && m_eventQueue.Count >= 2)
		{
			var eventToDelete = m_eventQueue.Dequeue();
			leftTotalTime -= eventToDelete.deltaTime;
		}

		//检查是否有摇动
		Int32 countToDeleteIfHasShake = 0;
		foreach (var oldEvent in m_eventQueue)
		{
			++countToDeleteIfHasShake;

			if ((e.acceleration - oldEvent.acceleration).sqrMagnitude >= m_shakeAccelerationThreshold * m_shakeAccelerationThreshold)
			{
				//有摇动,清除已经判定过的记录
				for (Int32 i=0; i<countToDeleteIfHasShake; ++i)
				{
					m_eventQueue.Dequeue();
				}

				//应用 shakeInterval
				m_leftShakeInterval = m_shakeInterval;

				RaiseShakeEvent();
				break;
			}
		}

		//添加记录
		m_eventQueue.Enqueue(e);

		//清除 shakeInterval 内的事件
		while (m_leftShakeInterval > 0 && m_eventQueue.Count > 0)
		{
			m_leftShakeInterval -= m_eventQueue.Dequeue().deltaTime;
		}
	}
コード例 #13
0
    static int GetAccelerationEvent(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Input.GetAccelerationEvent");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
            UnityEngine.AccelerationEvent o = UnityEngine.Input.GetAccelerationEvent(arg0);
            ToLua.PushValue(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #14
0
 public static UnityEngine.AccelerationEvent[] GetArray(ref UnityEngine.AccelerationEvent[] rList, long L, int nIndex)
 {
     try
     {
         long ptr        = FCLibHelper.fc_get_param_ptr(L, nIndex);
         int  nArraySize = FCLibHelper.fc_get_array_size(ptr);
         rList = new UnityEngine.AccelerationEvent[nArraySize];
         for (int i = 0; i < nArraySize; ++i)
         {
             long item_ptr = FCLibHelper.fc_get_array_node_temp_ptr(ptr, i);
             UnityEngine.AccelerationEvent item = FCGetObj.GetObj <UnityEngine.AccelerationEvent>(item_ptr);
             rList[i] = item;
         }
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(rList);
 }
コード例 #15
0
ファイル: Input.cs プロジェクト: lsx6244413/UnityDecomplie
 private static extern void INTERNAL_CALL_GetAccelerationEvent(int index, out AccelerationEvent value);
コード例 #16
0
 public UnityAccelerationEvent(AccelerationEvent accelerationEvent)
 {
     this.AccelerationEvent = accelerationEvent;
 }
コード例 #17
0
 public AccelerometerEventArgs(AccelerationEvent accelEvent)
 {
     m_AccelEvent = accelEvent;
 }
コード例 #18
0
ファイル: Input.cs プロジェクト: BlakeTriana/unity-decompiled
 private static extern void INTERNAL_CALL_GetAccelerationEvent(int index, out AccelerationEvent value);
コード例 #19
0
 static public int get_deltaTime(IntPtr l)
 {
     UnityEngine.AccelerationEvent o = (UnityEngine.AccelerationEvent)checkSelf(l);
     pushValue(l, o.deltaTime);
     return(1);
 }
コード例 #20
0
 static int _CreateAccelerationEvent(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 0);
     AccelerationEvent obj = new AccelerationEvent();
     LuaScriptMgr.PushValue(L, obj);
     return 1;
 }
コード例 #21
0
 private static extern void GetAccelerationEvent_Injected(int index, out AccelerationEvent ret);