Exemplo n.º 1
0
    public void Initinal()
    {
        isBattleOver = false;

        mapSystem = new BattleMapSystem(this);
        mapSystem.Initialize();
        buildingSystem = new BattleBuildingSystem(this);
        buildingSystem.Initialize();
        playerSystem = new BattlePlayerSystem(this);
        playerSystem.Initialize();
        inputSystem = new SLGInputSystem(this);
        inputSystem.Initialize();
        troopSystem = new BattleTroopSystem(this);
        troopSystem.Initialize();
        aiSystem = new BattleAISystem(this);
        aiSystem.Initialize();

        //显示初始化战斗面板
        ShowBattleUI();
        GameFacade.Instance.SendNotification(GlobalSetting.Msg_StartBattle);
        //初始化所有角色
        playerSystem.InitPlayers();
        GameFacade.Instance.SendNotification(GlobalSetting.Mst_PlayerGenerateComplete);
        //发送初始化战斗场景相机
        GameFacade.Instance.SendNotification(GlobalSetting.Msg_InitBattleCameraMediator);
        //调整相机位置到玩家位置
        //mapSystem.SetCameraPosition(playerSystem.UserMainBasePosition);
        FocuseUserMainBase();
        //生成地图
        mapSystem.PrintMap();
    }
Exemplo n.º 2
0
    public void Release()
    {
        GameFacade.Instance.SendNotification(GlobalSetting.Msg_EndBattle);

        inputSystem.Release();
        troopSystem.Release();
        playerSystem.Release();
        buildingSystem.Release();
        mapSystem.Release();

        inputSystem    = null;
        troopSystem    = null;
        playerSystem   = null;
        buildingSystem = null;
        mapSystem      = null;

        PoolManager.Instance.ClearData();
        System.GC.Collect();
    }
Exemplo n.º 3
0
 public BattlePlayerSystem(IBattleManager mgr) : base(mgr)
 {
     _BuildingSystem = battleManager.buildingSystem;
     _MapSystem      = battleManager.mapSystem;
 }