示例#1
0
        public override void Update(long tick)
        {
            if (BuffState != (byte)EBuffState.Running)
            {
                return;
            }

            long curTime = TCPManager.GetTimeStampMS();

            if (EndTime > 0 && curTime >= EndTime)
            {
                BuffEnded(false, false);
            }
            else if (NextTickTime > 0 && curTime >= NextTickTime)
            {
                NextTickTime += _buffInfo.Interval;

                OnUpdate?.Invoke(this, HeldObject, tick);

                if (_buffInfo.CommandInfo != null)
                {
                    foreach (BuffCommandInfo command in _buffInfo.CommandInfo)
                    {
                        if ((command.InvokeOn & (byte)EBuffState.Running) > 0)
                        {
                            BuffEffectInvoker.InvokeCommand(this, command, Target);
                        }
                    }
                }
            }
        }
示例#2
0
 public void Set(float newAmount)
 {
     Current = newAmount;
     Current = Mathf.Clamp(Current, 0, Max);
     OnUpdate?.Invoke(Current, Max);
 }
示例#3
0
 public override void Update()
 {
     OnUpdateDelegate?.Invoke();
 }