Пример #1
0
        }                                                             // base combatants only carried over from match

        // ---------------------------------------------------------------------------------------
        /// <summary>
        /// Create pawns for each combatant and place them in the world
        /// </summary>
        public void PlaceCombatants(MT_Arena arena)
        // ---------------------------------------------------------------------------------------
        {
            for (int i = 0; i < Combatants.Count; i++)
            {
                MT_ArenaSpawnPoint sp = arena.GetUnusedSpawnPoint(TeamNdx);
                if (sp == null)
                {
                    Dbg.LogError("Not enough spawn points for match! failure abounds!");
                    return;
                }
                sp.Used = true;

                Combatants[i].PlaceInArena(sp, arena.PawnRoot.transform);
            }
        }
Пример #2
0
        // ------------------------------------------------------------------------------
        protected override void Reset()
        // ------------------------------------------------------------------------------
        {
            base.Reset();

            if (_teams != null)
            {
                for (int i = 0; i < _teams.Count; i++)
                {
                    _teams[i].Shutdown();
                }
            }

            _arena      = null;
            _arenaDesc  = null;
            _matchState = State.Idle;
            _teams      = null;
        }
Пример #3
0
        // ------------------------------------------------------------------------------
        /// <summary>
        /// Called when we're really, really, really about to start the match
        /// </summary>
        /// <param name="ev"></param>
        void OnArenaReady(SM_SpaceStartedEvent ev)
        // ------------------------------------------------------------------------------
        {
            Debug.Log("Arena ready, placing combatants");
            _arena = ev.Space as MT_Arena;

            _widgetMgr = _arena.Widgets;

            for (int i = 0; i < GetTeamCount(); i++)
            {
                _teams[i].PlaceCombatants(_arena);

                //team.Combatants.Add(team.PlaceCombatants(i, _arena));
                //GetTeam(i).PlaceCombatants(i, _arena);
            }

            //### TODO add camera fade in here

            _currentTeamNdx = Rng.RandomInt(_teams.Count - 1);

            Events.SendGlobal(new LG_SimMatchStartedEvent(_matchInfo));
        }