Ejemplo n.º 1
0
    // 用关键帧移动窗口,可以设置回调函数
    public static void MOVE_KEYFRAME_WINDOW_EX(txUIObject uiObjct, string fileName, Vector3 startPos, Vector3 targetPos, float OnceLength, float offset, bool loop, bool fullonce, bool randomOffset, KeyFrameCallback TremblingCallBack, object TremblingUserData, KeyFrameCallback TrembleDoneCallBack, object TrembleDoneUserData)
    {
        CommandWindowKeyFrameMove cmd = mCommandSystem.newCmd <CommandWindowKeyFrameMove>(false);

        cmd.mName         = fileName;
        cmd.mOnceLength   = OnceLength;
        cmd.mStartPos     = startPos;
        cmd.mTargetPos    = targetPos;
        cmd.mOffset       = offset;
        cmd.mLoop         = loop;
        cmd.mFullOnce     = fullonce;
        cmd.mRandomOffset = randomOffset;
        cmd.setTremblingCallback(TremblingCallBack, TremblingUserData);
        cmd.setTrembleDoneCallback(TrembleDoneCallBack, TrembleDoneUserData);
        mCommandSystem.pushCommand(cmd, uiObjct);
    }
Ejemplo n.º 2
0
    public static void MOVE_KEYFRAME_WINDOW_EX(txUIObject 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_WINDOW(txUIObject obj, Vector3 pos)");
        }
        CommandWindowKeyFrameMove cmd = mCommandSystem.newCmd <CommandWindowKeyFrameMove>(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);
    }
Ejemplo n.º 3
0
    public static CommandWindowKeyFrameMove MOVE_KEYFRAME_WINDOW_DELAY_EX(LayoutScript script, txUIObject 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("时间或关键帧不能为空,如果要停止组件,请使用CommandWindowKeyFrameMove MOVE_WINDOW_DELAY(LayoutScript script, txUIObject obj, float delayTime, Vector3 pos)");
        }
        CommandWindowKeyFrameMove cmd = mCommandSystem.newCmd <CommandWindowKeyFrameMove>(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);
        script.addDelayCmd(cmd);
        return(cmd);
    }