Ejemplo n.º 1
0
        public override void OnMissionBehaviourInitialize(Mission mission)
        {
            base.OnMissionBehaviourInitialize(mission);
            try
            {
#if DEBUG
                //if (Utils.Config.Instance.EnableDevConsole())
                //{
                //    static void OnResetMission()
                //    {
                //        Console.WriteLine("OnResetMission");
                //    }
                //    static void OnEndMission()
                //    {
                //        Console.WriteLine("OnEndMission");
                //    }
                //    var listener = new Utils.BattlefieldControl.MissionListener(mission)
                //    {
                //        OnResetMission = OnResetMission,
                //        OnEndMission1 = OnEndMission,
                //    };
                //    mission.AddListener(listener);
                //    mission.AddMissionBehaviour(listener);
                //    Console.WriteLine($"OnMissionBehaviourInitialize({mission})");
                //    Console.WriteLine(
                //        $"Mode: {mission.Mode}, " +
                //        $"CurrentState:{mission.CurrentState}, " +
                //        $"CombatType: {mission.CombatType}, " +
                //        $"TimeSpeed: {mission.TimeSpeed}, " +
                //        $"IsFieldBattle: {mission.IsFieldBattle}, " +
                //        $"ForceTickOccasionally: {mission.ForceTickOccasionally}, " +
                //        $"IsTeleportingAgents: {mission.IsTeleportingAgents}, " +
                //        $"SceneLevels: {mission.SceneLevels}, " +
                //        $"SceneName: {mission.SceneName}, " +
                //        $"Time: {mission.Time}, " +
                //        $"MissionTeamAIType: {mission.MissionTeamAIType}, " +
                //        $"Agents.Count: {mission.Agents.Count}, " +
                //        $"AllAgents.Count: {mission.AllAgents.Count}, " +
                //        $"RetreatSide:{mission.RetreatSide}");
                //    foreach (var item in mission.Agents)
                //    {
                //        Console.WriteLine(
                //            $"Name:{item.Name}, " +
                //            $"Index: {item.Index}, " +
                //            $"State:{item.State}, " +
                //            $"IsHuman:{item.IsHuman}, " +
                //            $"IsHero:{item.IsHero}, " +
                //            $"IsMainAgent:{item.IsMainAgent}, " +
                //            $"IsAIControlled:{item.IsAIControlled}, " +
                //            $"IsPlayerControlled:{item.IsPlayerControlled}, " +
                //            $"IsMine:{item.IsMine}, " +
                //            $"Health:{item.Health}, " +
                //            $"HealthLimit:{item.HealthLimit}");
                //    }
                //    //if (mission.MissionBehaviours != null)
                //    //{
                //    //    foreach (var item in mission.MissionBehaviours)
                //    //    {
                //    //        Console.WriteLine(
                //    //            $"Name:{item}, " +
                //    //            $"BehaviourType: {item.BehaviourType}");
                //    //    }
                //    //}
                //    //if (mission.MissionLogics != null)
                //    //{
                //    //    foreach (var item in mission.MissionLogics)
                //    //    {
                //    //        Console.WriteLine(
                //    //            $"Name:{item}, " +
                //    //            $"BehaviourType: {item.BehaviourType}");
                //    //        if (item is BattleObserverMissionLogic battleObserverMissionLogic)
                //    //        {
                //    //            Console.WriteLine(
                //    //                $"BattleObserver:{battleObserverMissionLogic.BattleObserver}");
                //    //        }
                //    //    }
                //    //}
                //}
#endif
                mission.AddSetBattlefieldCommander();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }