private void InitBuff(BuffTypeEnum typeid, Vector3 pos) // 生成一个buff { Buff newBuff; switch (typeid) { case BuffTypeEnum.HealthBuff: newBuff = new HealthBuff(buffCounter, buffUnusedTime); break; case BuffTypeEnum.SpeedBuff: newBuff = new SpeedBuff(buffCounter, buffDefaultActiveTime, buffUnusedTime); break; case BuffTypeEnum.ShieldBuff: newBuff = new ShieldBuff(buffCounter, buffDefaultActiveCount, buffUnusedTime); break; case BuffTypeEnum.JumpBuff: newBuff = new JumpBuff(buffCounter, buffDefaultActiveTime, buffUnusedTime); break; default: return; } buffCounter++; buffList.Add(newBuff); var obj = Instantiate(buffPrefab); obj.GetComponent <BuffBehaviour>().SetBuff(newBuff); obj.transform.position = pos; buffObjects.Add(newBuff.buffId, obj); }
public CrateRewardCrate() { BuffEffectName = "Crate Reward"; BuffEffectChance = 2f; BuffType = BuffTypeEnum.Crate; IgnoreLuck = true; AddToList(); }
public BuffAddMessage(uint netId, byte buffSlot, BuffTypeEnum buffType, byte count, bool isHidden, uint buffNameHash, uint packageHash, float runningTime, float duration, uint casterNetId) : base(netId) { this.buffSlot = buffSlot; this.buffType = buffType; this.count = count; this.isHidden = isHidden; this.buffNameHash = buffNameHash; this.packageHash = packageHash; this.runningTime = runningTime; this.duration = duration; this.casterNetId = casterNetId; }