Пример #1
0
        private void GenBuff()
        {
            var buffID = FormulaUtil.RandomInProbDict(buffTypePriority);
            var _speed = CT.table.buffSpeedRange.random;
            var pos    = new Vector2(Random.Range(60, UIUtil.width - 60), UIUtil.height);
            var dir    = Quaternion.AngleAxis(CT.table.buffSpawnDirection.random, Vector3.forward) * Vector2.down;

            Buff.Create().Reset(buffID, pos, dir, _speed);
        }
Пример #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;
            }
        }