Esempio n. 1
0
        private void CreatePlayers(BattleParams.Player[] players)
        {
            FVec3 worldOffset =
                this._maze.LocalPointToGlobalPoint(new FVec3(this._maze.startPointPlace[0] * Fix64.Half, Fix64.Zero,
                                                             this._maze.startPointPlace[1] * Fix64.Half));
            FVec3 center = this._maze.centerOfStartRange;
            int   count  = players.Length;

            for (int i = 0; i < count; i++)
            {
                BattleParams.Player player = players[i];
                FVec2       rndCircle      = this._random.onUnitCircle;
                EntityParam entityParam    = new EntityParam
                {
                    rid      = player.cid + "@" + player.id,
                    uid      = player.id,
                    skin     = player.skin,
                    team     = player.team,
                    position = new FVec3(this._random.NextFix64(center.x - worldOffset.x, center.x + worldOffset.x),
                                         center.y,
                                         this._random.NextFix64(center.z - worldOffset.z, center.z + worldOffset.z)),
                    direction = new FVec3(rndCircle.x, Fix64.Zero, rndCircle.y)
                };
                Champion champion = this._entityManager.Create <Champion>(entityParam);
                champion.position = this.maze.RestrictInBounds(champion, true);
            }
        }
Esempio n. 2
0
        private void CreatePlayers(BattleParams battleParams)
        {
            int count = battleParams.players.Length;

            for (int i = 0; i < count; i++)
            {
                BattleParams.Player player = battleParams.players[i];
                EntityParam         param  = new EntityParam();
                param.rid       = player.cid + "@" + player.id;
                param.uid       = player.id;
                param.position  = this.RandomPoint(this.data.bornPos1, this.data.bornRange);
                param.direction = this.data.bornDir1;
                param.team      = player.team;
                this._entityManager.CreateBio(param);
            }
        }