Exemple #1
0
        public TableBuffKillGen Get(int id)
        {
            TableBuffKillGen data = null;

            _ins.mDict.TryGetValue(id, out data);
            return(data);
        }
Exemple #2
0
        private void GenBuff()
        {
            bool  isGen = false;
            var   _tab  = TableBuffKillGen.Get(a => a.gameLevel.Contains(D.I.gameLevel) && a.streak == D.I.streak);
            var   _prob = D.I.IsVip() ? _tab.vipProbability : _tab.probability;
            float ratio = _prob * D.I.kills4Buff;

            if (Random.value <= ratio)
            {
                isGen = true;
                var _typeProb = D.I.IsVip() ? _tab.vipBuffTypePriority : _tab.buffTypePriority;
                var buffID    = FormulaUtil.RandomInProbDict(_typeProb);
                var _speed    = CT.table.buffSpeedRange.random;
                var dir       = Quaternion.AngleAxis(CT.table.buffSpawnDirection.random, Vector3.forward) * Vector2.down;
                Buff.Create().Reset(buffID, position, dir, _speed);
            }

            if (isGen)
            {
                D.I.kills4Buff = 0;
            }
        }