public static void MOVE_OBJECT_PHY_EX(MovableObject obj, string fileName, Vector3 startPos, Vector3 targetPos, float onceLength, bool loop, float offset, KeyFrameCallback TremblingCallBack, KeyFrameCallback TrembleDoneCallBack) { if (fileName == "" || MathUtility.isFloatZero(onceLength)) { UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用void MOVE_OBJECT_PHY(MovableObject obj, Vector3 pos)"); } CommandMovableObjectMovePhysics cmd = mCommandSystem.newCmd <CommandMovableObjectMovePhysics>(false, false); cmd.mName = fileName; cmd.mOnceLength = onceLength; cmd.mStartPos = startPos; cmd.mTargetPos = targetPos; cmd.mOffset = offset; cmd.mLoop = loop; cmd.setTremblingCallback(TremblingCallBack, null); cmd.setTrembleDoneCallback(TrembleDoneCallBack, null); mCommandSystem.pushCommand(cmd, obj); }
public static CommandMovableObjectMovePhysics MOVE_OBJECT_PHY_DELAY_EX(MovableObject obj, float delayTime, string keyframe, Vector3 startPos, Vector3 targetPos, float onceLength, bool loop, float offset, KeyFrameCallback movingCallback, KeyFrameCallback moveDoneCallback) { if (keyframe == "" || MathUtility.isFloatZero(onceLength)) { UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,CommandMovableObjectMovePhysics MOVE_OBJECT_PHY_DELAY(MovableObject obj, float delayTime, Vector3 pos)"); } CommandMovableObjectMovePhysics cmd = mCommandSystem.newCmd <CommandMovableObjectMovePhysics>(false, true); cmd.mName = keyframe; cmd.mStartPos = startPos; cmd.mTargetPos = targetPos; cmd.mOnceLength = onceLength; cmd.mOffset = offset; cmd.mLoop = loop; cmd.setTremblingCallback(movingCallback, null); cmd.setTrembleDoneCallback(moveDoneCallback, null); mCommandSystem.pushDelayCommand(cmd, obj, delayTime); return(cmd); }