Example #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();
    }
    public MapCreator(BattleMapSystem mapSystem)
    {
        this.mapSystem = mapSystem;

        //测试数据
        weights = mapSystem.weights;
        width   = mapSystem.width;
        height  = mapSystem.height;
        xOriMax = mapSystem.xOriMax;
        yOriMax = mapSystem.yOriMax;
        scale   = mapSystem.scale;

        totalWeight = 0;
        for (int i = 0; i < weights.Length; i++)
        {
            totalWeight += weights[i];
        }

        tileMaxVals    = new float[weights.Length];
        tileMaxVals[0] = 0;
        for (int i = 1; i < weights.Length; i++)
        {
            tileMaxVals[i] = weights[i - 1] / totalWeight + tileMaxVals[i - 1];
        }
    }
    public MapChecker(BattleMapSystem battleMapSystem)
    {
        mapSystem = battleMapSystem;

        height   = mapSystem.height;
        width    = mapSystem.width;
        walkable = mapSystem.walkable;
    }
Example #4
0
 public MapPrinter(BattleMapSystem battleMapSystem, Transform tileParent)
 {
     this.tileParent      = tileParent;
     this.battleMapSystem = battleMapSystem;
     this.tiles           = battleMapSystem.tiles;
     this.width           = battleMapSystem.width;
     this.height          = battleMapSystem.height;
     this.tileNames       = battleMapSystem.tileNames;
 }
    public Map45DegreesPrinter(BattleMapSystem mapSystem, Transform tileParent)
    {
        width           = mapSystem.width;
        height          = mapSystem.height;
        tiles           = new Transform[width, height];
        this.tileParent = tileParent;
        tileNames       = mapSystem.tileNames;

        for (int i = 0; i < tileNames.Length; i++)
        {
            dicRecoveryObject.Add(tileNames[i], new Stack <Transform>());
        }
    }
Example #6
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();
    }
 public BattleBuildingSystem(IBattleManager battleMgr) : base(battleMgr)
 {
     _MapSystem       = battleManager.mapSystem;
     _BuildingVOProxy = facade.RetrieveProxy(BuildingVOProxy.NAME) as BuildingVOProxy;
 }
Example #8
0
 public BattlePlayerSystem(IBattleManager mgr) : base(mgr)
 {
     _BuildingSystem = battleManager.buildingSystem;
     _MapSystem      = battleManager.mapSystem;
 }