Beispiel #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);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public void Set(float newAmount)
 {
     Current = newAmount;
     Current = Mathf.Clamp(Current, 0, Max);
     OnUpdate?.Invoke(Current, Max);
 }
Beispiel #3
0
 public override void Update()
 {
     OnUpdateDelegate?.Invoke();
 }