Exemple #1
0
    // 用关键帧窗口透明度震动,可以设置回调函数
    public static void ALPHA_TREMBLE_WINDOW_EX(txUIObject obj, string name, float start, float target, bool loop, float onceLength, float offset, bool randomOffset, KeyFrameCallback tremblingCallback, object tremblingUserData, KeyFrameCallback trembleDoneCallback, object trembleDoneUserData)
    {
        CommandWindowAlphaTremble cmd = mCommandSystem.newCmd <CommandWindowAlphaTremble>(false);

        cmd.mName         = name;
        cmd.mLoop         = loop;
        cmd.mOnceLength   = onceLength;
        cmd.mOffset       = offset;
        cmd.mStartAlpha   = start;
        cmd.mTargetAlpha  = target;
        cmd.mRandomOffset = randomOffset;
        cmd.setTremblingCallback(tremblingCallback, tremblingUserData);
        cmd.setTrembleDoneCallback(trembleDoneCallback, trembleDoneUserData);
        mCommandSystem.pushCommand(cmd, obj);
    }
Exemple #2
0
    public static void ALPHA_KEYFRAME_WINDOW_EX(txUIObject obj, string name, float start, float target, float onceLength, bool loop, float offset, KeyFrameCallback tremblingCallback, KeyFrameCallback trembleDoneCallback)
    {
        if (name == "" || MathUtility.isFloatZero(onceLength))
        {
            UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用void ALPHA_WINDOW(txUIObject obj, float alpha)");
        }
        CommandWindowAlphaTremble cmd = mCommandSystem.newCmd <CommandWindowAlphaTremble>(false);

        cmd.mName        = name;
        cmd.mLoop        = loop;
        cmd.mOnceLength  = onceLength;
        cmd.mOffset      = offset;
        cmd.mStartAlpha  = start;
        cmd.mTargetAlpha = target;
        cmd.setTremblingCallback(tremblingCallback, null);
        cmd.setTrembleDoneCallback(trembleDoneCallback, null);
        mCommandSystem.pushCommand(cmd, obj);
    }
Exemple #3
0
    public static CommandWindowAlphaTremble ALPHA_KEYFRAME_WINDOW_DELAY_EX(LayoutScript script, txUIObject obj, float delayTime, string keyframe, float start, float target, float onceLength, bool loop, float offset, KeyFrameCallback tremblingCallback, KeyFrameCallback trembleDoneCallback)
    {
        if (keyframe == "" || MathUtility.isFloatZero(onceLength))
        {
            UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用CommandWindowAlphaTremble ALPHA_WINDOW_DELAY(LayoutScript script, txUIObject obj, float delayTime, float alpha)");
        }
        CommandWindowAlphaTremble cmd = mCommandSystem.newCmd <CommandWindowAlphaTremble>(false, true);

        cmd.mName        = keyframe;
        cmd.mLoop        = loop;
        cmd.mOnceLength  = onceLength;
        cmd.mOffset      = offset;
        cmd.mStartAlpha  = start;
        cmd.mTargetAlpha = target;
        cmd.setTremblingCallback(tremblingCallback, null);
        cmd.setTrembleDoneCallback(trembleDoneCallback, null);
        mCommandSystem.pushDelayCommand(cmd, obj, delayTime);
        script.addDelayCmd(cmd);
        return(cmd);
    }