コード例 #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="players">玩家集合</param>
        /// <param name="barrierId">关卡类型id</param>
        public void Start(List <Tuple <string, int, int, int, int> > players)
        {
            Log.Trace("Start 开始生成");
            Random r = new Random();

            //TODO 可能进行动态初始化
            foreach (var player in players)
            {
                var id = _createComponent.GetCreateID();
                this.players.Add(player.Item1, id);
                _eventComponent.AddEventMessagesToHandlerForward(new InitEventMessage(id, LevelActorBase.PlayerCamp,
                                                                                      player.Item3, r.Next(-300, -100), r.Next(-300, -100), 0, 0.1f, true, player.Item4, player.Item5, player.Item1));
            }

            //开启所有任务
            _taskEventComponent.StartTaskEvents();



            //动态初始化任务配置
            //AddPrepareTask();

            //设置空气墙
            _envirinfoComponent.AddAirWall();


            //动态初始化敌人
            //PrepareEnemy();
            isStart = true;
            Log.Trace("Start 生成完成");

            OnStartDone?.Invoke();
        }
コード例 #2
0
 void sendStartResult()
 {
     if (null != OnStartDone)
     {
         OnStartDone.Invoke();
         OnStartDone = null;
     }
 }
コード例 #3
0
        /// <summary>
        /// 客户端Start函数
        /// </summary>
        public void Start()
        {
            //AddPrepareTask();
            isStart = true;
            _envirinfoComponent.AddAirWall();

            OnStartDone?.Invoke();
        }