Ejemplo n.º 1
0
    //--------------------------------------------------------------------------------------------------------------------------------------------
    // 缩放
    #region 用关键帧缩放物体
    public static void SCALE_OBJECT(MovableObject obj, Vector2 scale)
    {
        CommandMovableObjectScale cmd = mCommandSystem.newCmd <CommandMovableObjectScale>(false);

        cmd.mName        = "";
        cmd.mOnceLength  = 0.0f;
        cmd.mStartScale  = scale;
        cmd.mTargetScale = scale;
        mCommandSystem.pushCommand(cmd, obj);
    }
Ejemplo n.º 2
0
    public static CommandMovableObjectScale SCALE_OBJECT_DELAY(MovableObject obj, float delayTime, Vector2 scale)
    {
        CommandMovableObjectScale cmd = mCommandSystem.newCmd <CommandMovableObjectScale>(false, true);

        cmd.mName        = "";
        cmd.mOnceLength  = 0.0f;
        cmd.mStartScale  = scale;
        cmd.mTargetScale = scale;
        mCommandSystem.pushDelayCommand(cmd, obj, delayTime);
        return(cmd);
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    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);
    }