Beispiel #1
0
 public static CommandWindowAlphaPath ALPH_PATH_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime)
 {
     if (obj == null)
     {
         return(null);
     }
     return(pushDelayMainCommand <CommandWindowAlphaPath>(watcher, obj, delayTime, false));
 }
Beispiel #2
0
 public static CommandWindowActive ACTIVE_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, bool active, float delayTime, CommandCallback startCallback)
 {
     CMD(out CommandWindowActive cmd, false, true);
     cmd.mActive = active;
     cmd.addStartCommandCallback(startCallback);
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #3
0
 public static CommandMovableObjectPlayAudio AUDIO_DELAY(IDelayCmdWatcher watcher, MovableObject obj, float delayTime)
 {
     if (obj == null)
     {
         return(null);
     }
     return(pushDelayMainCommand <CommandMovableObjectPlayAudio>(watcher, obj, delayTime, false));
 }
Beispiel #4
0
 public static CommandWindowAlpha ALPHA_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, float alpha)
 {
     CMD(out CommandWindowAlpha cmd, false, true);
     cmd.mOnceLength  = 0.0f;
     cmd.mStartAlpha  = alpha;
     cmd.mTargetAlpha = alpha;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #5
0
 public static CommandWindowColor COLOR_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, Color color)
 {
     CMD(out CommandWindowColor cmd, false, true);
     cmd.mOnceLength  = 0.0f;
     cmd.mStartColor  = color;
     cmd.mTargetColor = color;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #6
0
 public static CommandWindowPlayAudio AUDIO_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, SOUND_DEFINE sound, bool loop)
 {
     CMD(out CommandWindowPlayAudio cmd, false, true);
     cmd.mSound        = sound;
     cmd.mLoop         = loop;
     cmd.mUseVolumeCoe = true;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #7
0
 public static CommandLayoutManagerVisible VISIBLE_LAYOUT_DELAY_FORCE(IDelayCmdWatcher watcher, float delayTime, int type, bool visible)
 {
     CMD(out CommandLayoutManagerVisible cmd, true, true);
     cmd.mLayoutID    = type;
     cmd.mForce       = true;
     cmd.mVisibility  = visible;
     cmd.mImmediately = false;
     pushDelayCommand(cmd, mLayoutManager, delayTime, watcher);
     return(cmd);
 }
Beispiel #8
0
 public static CommandTimeManagerScaleTime TIME_DELAY(IDelayCmdWatcher watcher, float delayTime, float scale)
 {
     CMD(out CommandTimeManagerScaleTime cmd, false, true);
     cmd.mStartScale  = scale;
     cmd.mTargetScale = scale;
     cmd.mOnceLength  = 0.0f;
     pushDelayCommand(cmd, mTimeManager, delayTime, watcher);
     cmd.setIgnoreTimeScale(true);
     return(cmd);
 }
Beispiel #9
0
 public static CommandWindowFill FILL_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, float start, float target, float time, KeyFrameCallback doneCallback)
 {
     CMD(out CommandWindowFill cmd, false, true);
     cmd.mStartValue   = start;
     cmd.mTargetValue  = target;
     cmd.mOnceLength   = time;
     cmd.mKeyframe     = KEY_FRAME.ZERO_ONE;
     cmd.mDoneCallback = doneCallback;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #10
0
 public static CommandMovableObjectActive ACTIVE_DELAY_EX(IDelayCmdWatcher watcher, MovableObject obj, bool active, float dealyTime, CommandCallback startCallback)
 {
     if (obj == null)
     {
         return(null);
     }
     CMD(out CommandMovableObjectActive cmd, false, true);
     cmd.mActive = active;
     cmd.addStartCommandCallback(startCallback);
     pushDelayCommand(cmd, obj, dealyTime, watcher);
     return(cmd);
 }
Beispiel #11
0
 public static CommandLayoutManagerVisible VISIBLE_LAYOUT_DELAY_EX(IDelayCmdWatcher watcher, float delayTime, int id, bool visible, CommandCallback start, bool immediately = false, string param = null)
 {
     CMD(out CommandLayoutManagerVisible cmd, true, true);
     cmd.mLayoutID    = id;
     cmd.mForce       = false;
     cmd.mVisibility  = visible;
     cmd.mImmediately = immediately;
     cmd.mParam       = param;
     cmd.addStartCommandCallback(start);
     pushDelayCommand(cmd, mLayoutManager, delayTime, watcher);
     return(cmd);
 }
Beispiel #12
0
 public static CommandMovableObjectAlpha ALPHA_DELAY(IDelayCmdWatcher watcher, MovableObject obj, float delayTime, float alpha)
 {
     if (obj == null)
     {
         return(null);
     }
     CMD(out CommandMovableObjectAlpha cmd, false, true);
     cmd.mOnceLength  = 0.0f;
     cmd.mStartAlpha  = alpha;
     cmd.mTargetAlpha = alpha;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #13
0
 public static CommandTimeManagerScaleTime TIME_DELAY_EX(IDelayCmdWatcher watcher, float delayTime, KEY_FRAME keyframe, float start, float target, float onceLength, bool loop, float offset, KeyFrameCallback movingCallback, KeyFrameCallback moveDoneCallback)
 {
     CMD(out CommandTimeManagerScaleTime cmd, false, true);
     cmd.mKeyframe      = keyframe;
     cmd.mStartScale    = start;
     cmd.mTargetScale   = target;
     cmd.mOnceLength    = onceLength;
     cmd.mOffset        = offset;
     cmd.mLoop          = loop;
     cmd.mDoingCallBack = movingCallback;
     cmd.mDoneCallBack  = moveDoneCallback;
     pushDelayCommand(cmd, mTimeManager, delayTime, watcher);
     cmd.setIgnoreTimeScale(true);
     return(cmd);
 }
Beispiel #14
0
 public static CommandWindowAlphaPath ALPH_PATH_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, Dictionary <float, float> valueKeyFrame, float valueOffset, float speed, bool loop, float offset, KeyFrameCallback doingCallback, KeyFrameCallback doneCallback)
 {
     if (obj == null)
     {
         return(null);
     }
     CMD(out CommandWindowAlphaPath cmd, false, true);
     cmd.mValueKeyFrame = valueKeyFrame;
     cmd.mValueOffset   = valueOffset;
     cmd.mSpeed         = speed;
     cmd.mOffset        = offset;
     cmd.mLoop          = loop;
     cmd.mDoingCallBack = doingCallback;
     cmd.mDoneCallBack  = doneCallback;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #15
0
 public static CommandWindowColor COLOR_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, KEY_FRAME keyframe, Color start, Color target, float onceLength, bool loop, float offset, KeyFrameCallback doingCallback, KeyFrameCallback doneCallback)
 {
     if (keyframe == KEY_FRAME.NONE || isFloatZero(onceLength))
     {
         logError("时间或关键帧不能为空,如果要停止组件,请使用CommandWindowAlpha ALPHA_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, float alpha)");
         return(null);
     }
     CMD(out CommandWindowColor cmd, false, true);
     cmd.mKeyframe      = keyframe;
     cmd.mLoop          = loop;
     cmd.mOnceLength    = onceLength;
     cmd.mOffset        = offset;
     cmd.mStartColor    = start;
     cmd.mTargetColor   = target;
     cmd.mDoingCallback = doingCallback;
     cmd.mDoneCallback  = doneCallback;
     pushDelayCommand(cmd, obj, delayTime, watcher);
     return(cmd);
 }
Beispiel #16
0
    public static CommandMovableObjectPlayAudio AUDIO_DELAY(IDelayCmdWatcher watcher, MovableObject obj, float delayTime, SOUND_DEFINE sound, bool loop, float volume, bool useVolumeCoe)
    {
        if (obj == null)
        {
            return(null);
        }
        string name = (sound != SOUND_DEFINE.MIN) ? mAudioManager.getAudioName(sound) : null;

        if (isEmpty(name))
        {
            logError("sound name must be valid, use CommandMovableObjectPlayAudio AUDIO_DELAY(MovableObject obj, float delayTime) to stop sound");
            return(null);
        }
        CMD(out CommandMovableObjectPlayAudio cmd, false, true);
        cmd.mSound        = sound;
        cmd.mLoop         = loop;
        cmd.mVolume       = volume;
        cmd.mUseVolumeCoe = useVolumeCoe;
        pushDelayCommand(cmd, obj, delayTime, watcher);
        return(cmd);
    }
Beispiel #17
0
 public static CommandWindowAlphaPath ALPH_PATH_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, Dictionary <float, float> valueKeyFrame)
 {
     return(ALPH_PATH_DELAY_EX(watcher, obj, delayTime, valueKeyFrame, 1.0f, 1.0f, false, 0.0f, null, null));
 }
Beispiel #18
0
 public static CommandWindowColor COLOR_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, KEY_FRAME keyframe, Color start, Color target, float onceLength, KeyFrameCallback doingCallback, KeyFrameCallback doneCallback)
 {
     return(COLOR_DELAY_EX(watcher, obj, delayTime, keyframe, start, target, onceLength, false, 0.0f, doingCallback, doneCallback));
 }
Beispiel #19
0
 public static CommandWindowColor COLOR_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, KEY_FRAME keyframe, Color start, Color target, float onceLength, bool loop, float offset)
 {
     return(COLOR_DELAY_EX(watcher, obj, delayTime, keyframe, start, target, onceLength, loop, offset, null, null));
 }
Beispiel #20
0
 public static CommandWindowActive ACTIVE_DELAY(IDelayCmdWatcher watcher, myUIObject obj, bool active, float delayTime)
 {
     return(ACTIVE_DELAY_EX(watcher, obj, active, delayTime, null));
 }
Beispiel #21
0
 public static CommandWindowAlpha ALPHA_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, float start, float target, float onceLength, KeyFrameCallback doingCallback, KeyFrameCallback doneCallback)
 {
     return(ALPHA_DELAY_EX(watcher, obj, delayTime, KEY_FRAME.ZERO_ONE, start, target, onceLength, false, 0.0f, doingCallback, doneCallback));
 }
Beispiel #22
0
    public Command pushDelayCommand(Type type, CommandReceiver cmdReceiver, float delayExecute, bool show, IDelayCmdWatcher watcher)
    {
        // 如果命令系统已经销毁了,则不能再发送命令
        if (mDestroy)
        {
            return(null);
        }
        Command cmd = newCmd(type, show, true);

        pushDelayCommand(cmd, cmdReceiver, delayExecute, watcher);
        return(cmd);
    }
Beispiel #23
0
 public static CommandWindowFill FILL_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, float start, float target, float time)
 {
     return(FILL_DELAY_EX(watcher, obj, delayTime, start, target, time, null));
 }
Beispiel #24
0
 public static CommandWindowAlphaPath ALPH_PATH_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, Dictionary <float, float> valueKeyFrame, float valueOffset, float speed, bool loop, float offset)
 {
     return(ALPH_PATH_DELAY_EX(watcher, obj, delayTime, valueKeyFrame, valueOffset, speed, loop, offset, null, null));
 }
Beispiel #25
0
 public static CommandWindowAlphaPath ALPH_PATH_DELAY_EX(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, Dictionary <float, float> valueKeyFrame, float valueOffset, float speed, KeyFrameCallback doingCallback, KeyFrameCallback doneCallback)
 {
     return(ALPH_PATH_DELAY_EX(watcher, obj, delayTime, valueKeyFrame, valueOffset, speed, false, 0.0f, doingCallback, doneCallback));
 }
Beispiel #26
0
 public static CommandWindowColor COLOR_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, Color start, Color target, float onceLength)
 {
     return(COLOR_DELAY_EX(watcher, obj, delayTime, KEY_FRAME.ZERO_ONE, start, target, onceLength, false, 0.0f, null, null));
 }
Beispiel #27
0
 public static CommandWindowAlpha ALPHA_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, float start, float target, float onceLength)
 {
     return(ALPHA_DELAY_EX(watcher, obj, delayTime, KEY_FRAME.ZERO_ONE, start, target, onceLength, false, 0.0f, null, null));
 }
Beispiel #28
0
 public static void UNLOAD_LAYOUT_DELAY(IDelayCmdWatcher watcher, int id, float delayTime)
 {
     CMD(out CommandLayoutManagerUnload cmd, true, true);
     cmd.mLayoutID = id;
     pushDelayCommand(cmd, mLayoutManager, delayTime, watcher);
 }
Beispiel #29
0
    // delayExecute是命令延时执行的时间,默认为0,只有new出来的命令才能延时执行
    // 子线程中发出的命令必须是延时执行的命令!
    public new void pushDelayCommand(Command cmd, CommandReceiver cmdReceiver, float delayExecute, IDelayCmdWatcher watcher)
    {
        // 如果命令系统已经销毁了,则不能再发送命令
        if (mDestroy)
        {
            return;
        }
        if (cmd == null)
        {
            logError("cmd is null! receiver : " + (cmdReceiver != null ? cmdReceiver.getName() : EMPTY));
            return;
        }
        if (cmdReceiver == null)
        {
            logError("receiver is null! cmd : " + (cmd != null ? cmd.GetType().ToString() : EMPTY));
            return;
        }
        if (cmd.isDestroy())
        {
            logError("cmd is invalid! make sure create cmd use CommandSystem.newCmd! pushDelayCommand cmd type : "
                     + Typeof(cmd) + "cmd id : " + cmd.getAssignID());
            return;
        }
        if (!cmd.isDelayCommand())
        {
            logError("cmd is not a delay command, Command : " + cmd.getAssignID() + ", " + cmd.showDebugInfo());
            return;
        }
        clampMin(ref delayExecute);
        if (cmd.isShowDebugInfo())
        {
#if UNITY_EDITOR || DEVELOPMENT_BUILD
            log("CMD : delay cmd : " + cmd.getAssignID() + ", " + delayExecute + ", info : " + cmd.showDebugInfo() + ", receiver : " + cmdReceiver.getName(), LOG_LEVEL.NORMAL);
#endif
        }
        cmd.setDelayTime(delayExecute);
        cmd.setReceiver(cmdReceiver);
        mBufferLock.waitForUnlock();
        mCommandBufferInput.Add(cmd);
        mBufferLock.unlock();
        watcher?.addDelayCmd(cmd);
    }
Beispiel #30
0
 public static CommandWindowAlpha ALPHA_DELAY(IDelayCmdWatcher watcher, myUIObject obj, float delayTime, KEY_FRAME keyframe, float start, float target, float onceLength, bool loop)
 {
     return(ALPHA_DELAY_EX(watcher, obj, delayTime, keyframe, start, target, onceLength, loop, 0.0f, null, null));
 }