static public int GetRelativePointVelocity(IntPtr l)
 {
     try {
         UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l);
         UnityEngine.Vector3   a1;
         checkType(l, 2, out a1);
         var ret = self.GetRelativePointVelocity(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
		public override void OnEnter ()
		{
			rigidbody = ownerDefault.GetComponent<UnityEngine.Rigidbody> ();
			Vector3 velocity = Vector3.zero;
			switch (space) {
			case Space.Self:
				velocity=rigidbody.GetRelativePointVelocity (owner.GetValue (position));
				break;
			case Space.World:
				velocity=rigidbody.GetPointVelocity (owner.GetValue (position));
				break;
			}
			owner.SetVector3 (store,velocity);
			Finish ();
		}
Пример #3
0
 static int GetRelativePointVelocity(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Rigidbody obj  = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody));
         UnityEngine.Vector3   arg0 = ToLua.ToVector3(L, 2);
         UnityEngine.Vector3   o    = obj.GetRelativePointVelocity(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        public override void OnEnter()
        {
            rigidbody = ownerDefault.GetComponent <UnityEngine.Rigidbody> ();
            Vector3 velocity = Vector3.zero;

            switch (space)
            {
            case Space.Self:
                velocity = rigidbody.GetRelativePointVelocity(owner.GetValue(position));
                break;

            case Space.World:
                velocity = rigidbody.GetPointVelocity(owner.GetValue(position));
                break;
            }
            owner.SetVector3(store, velocity);
            Finish();
        }