Ejemplo n.º 1
0
        public void RemoveBuff(BuffScript buff)
        {
            buff.OnRemoved();
            Buffs.Remove(buff.Slot);

            Owner.Game.Send(new BuffRemoveMessage(Owner.NetId, buff.Slot, buff.BuffName.HashString(), 0f));
        }
Ejemplo n.º 2
0
    public BuffScript GetBuffWithName(string name)
    {
        BuffScript res = null;

        foreach (BuffScript buff in buffs)
        {
            if (buff.buffName == name)
            {
                res = buff;
            }
        }
        return(res);
    }
Ejemplo n.º 3
0
    public void AddBuff(BuffScript prefabBuff)
    {
        BuffScript buff = GetBuffWithName(prefabBuff.buffName);

        if (buff == null)
        {
            buff = Instantiate(prefabBuff);
            buff.gameObject.transform.SetParent(unit.transform, false);
            buff.AddBuffTo(buffs);
            buff.ApplyBaseEffect(unit);
        }
        else
        {
            buff.buffTimer = 0f;
        }
    }