Example #1
0
 public static void Rotate(UnityEngine.Rigidbody rigidbody, Vector3 rotation)
 {
     if (rotation == Vector3.zero)
     {
         return;
     }
     rigidbody.MoveRotation(rigidbody.rotation * Quaternion.Euler(rotation));
 }
 static public int MoveRotation(IntPtr l)
 {
     try {
         UnityEngine.Rigidbody  self = (UnityEngine.Rigidbody)checkSelf(l);
         UnityEngine.Quaternion a1;
         checkType(l, 2, out a1);
         self.MoveRotation(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #3
0
        private void FixedUpdate()
        {
            if (!doUpdate)
            {
                return;
            }

            t += Time.deltaTime * 10;            // / timeToReachTarget;

            //rb.MovePosition(Vector3.Lerp(syncStartPosition, syncEndPosition, t));
            //rb.MoveRotation(Quaternion.Lerp(syncStartRotation, syncEndRotation, t));
            rb.MovePosition(syncEndPosition);
            rb.MoveRotation(syncEndRotation);
        }
Example #4
0
 static int MoveRotation(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Rigidbody  obj  = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody));
         UnityEngine.Quaternion arg0 = ToLua.ToQuaternion(L, 2);
         obj.MoveRotation(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }