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));
    }
 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
 }
// 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);
    }
	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);
		}
	}
Beispiel #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));
     }
 }
 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;
     }
 }
Beispiel #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);
     }
 }
 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);
     }
 }
 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));
     }
 }
Beispiel #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));
     }
 }
 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);
 }
Beispiel #12
0
	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;
		}
	}
    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));
        }
    }
 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);
 }
Beispiel #15
0
 private static extern void INTERNAL_CALL_GetAccelerationEvent(int index, out AccelerationEvent value);
 public UnityAccelerationEvent(AccelerationEvent accelerationEvent)
 {
     this.AccelerationEvent = accelerationEvent;
 }
 public AccelerometerEventArgs(AccelerationEvent accelEvent)
 {
     m_AccelEvent = accelEvent;
 }
Beispiel #18
0
 private static extern void INTERNAL_CALL_GetAccelerationEvent(int index, out AccelerationEvent value);
Beispiel #19
0
 static public int get_deltaTime(IntPtr l)
 {
     UnityEngine.AccelerationEvent o = (UnityEngine.AccelerationEvent)checkSelf(l);
     pushValue(l, o.deltaTime);
     return(1);
 }
 static int _CreateAccelerationEvent(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 0);
     AccelerationEvent obj = new AccelerationEvent();
     LuaScriptMgr.PushValue(L, obj);
     return 1;
 }
Beispiel #21
0
 private static extern void GetAccelerationEvent_Injected(int index, out AccelerationEvent ret);