Exemple #1
0
    public IBuff NewBuff(IBuff.BuffType type)
    {
        IBuff buff = null;

        if (mRecoveryBuffList[(int)type].Count > 0)
        {
            buff = mRecoveryBuffList[(int)type].Pop();
        }
        else
        {
            if (type == IBuff.BuffType.Move)
            {
                buff = new MoveBuff();
            }
            else if (type == IBuff.BuffType.Behavior)
            {
                buff = new BehaviorBuff();
            }
            else if (type == IBuff.BuffType.Hurt)
            {
                buff = new HurtBuff();
            }
            else if (type == IBuff.BuffType.Control)
            {
                buff = new ControlBuff();
            }
        }

        buff.mInstId = ++mInstId;
        return(buff);
    }
Exemple #2
0
    public bool EnableSelect()
    {
        bool enable = true;

        foreach (var item in mCurrBuffList[(int)IBuff.BuffType.Control])
        {
            if (item.Value is ControlBuff)
            {
                ControlBuff cb = item.Value as ControlBuff;
                if (cb.mControlBuffConfig.mEnableSelect == false)
                {
                    enable = false;
                    break;
                }
            }
        }

        return(enable);
    }