public static void SCALE_OBJECT_EX(MovableObject obj, string fileName, Vector2 start, Vector2 target, float onceLength, bool loop, float offset, KeyFrameCallback scaleTremblingCallback, KeyFrameCallback scaleTrembleDoneCallback) { if (fileName == "" || MathUtility.isFloatZero(onceLength)) { UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用void SCALE_OBJECT(MovableObject obj, Vector2 scale)"); } CommandMovableObjectScale cmd = mCommandSystem.newCmd <CommandMovableObjectScale>(false); cmd.mName = fileName; cmd.mOnceLength = onceLength; cmd.mOffset = offset; cmd.mLoop = loop; cmd.mStartScale = start; cmd.mTargetScale = target; cmd.setTremblingCallback(scaleTremblingCallback, null); cmd.setTrembleDoneCallback(scaleTrembleDoneCallback, null); mCommandSystem.pushCommand(cmd, obj); }
public static CommandMovableObjectScale SCALE_OBJECT_DELAY_EX(MovableObject obj, float delayTime, string keyframe, Vector2 start, Vector2 target, float onceLength, bool loop, float offset, KeyFrameCallback scaleTremblingCallback, KeyFrameCallback scaleTrembleDoneCallback) { if (keyframe == "" || MathUtility.isFloatZero(onceLength)) { UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用CommandMovableObjectScale SCALE_OBJECT_DELAY(MovableObject obj, float delayTime, Vector2 scale)"); } CommandMovableObjectScale cmd = mCommandSystem.newCmd <CommandMovableObjectScale>(false, true); cmd.mName = keyframe; cmd.mOnceLength = onceLength; cmd.mOffset = offset; cmd.mLoop = loop; cmd.mStartScale = start; cmd.mTargetScale = target; cmd.setTremblingCallback(scaleTremblingCallback, null); cmd.setTrembleDoneCallback(scaleTrembleDoneCallback, null); mCommandSystem.pushDelayCommand(cmd, obj, delayTime); return(cmd); }