コード例 #1
0
        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);
        }
コード例 #2
0
        public CrateRewardCrate()
        {
            BuffEffectName   = "Crate Reward";
            BuffEffectChance = 2f;
            BuffType         = BuffTypeEnum.Crate;
            IgnoreLuck       = true;

            AddToList();
        }
コード例 #3
0
ファイル: BuffAddMessage.cs プロジェクト: sahlie1985/Legends
 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;
 }