Ejemplo n.º 1
0
 void OnDestroy()
 {
     if (mapControl != null)
     {
         mapControl.Free();
         mapControl = null;
     }
 }
Ejemplo n.º 2
0
 private void FreeMapControl()
 {
     if (mapControl != null)
     {
         mapControl.Free();
         mapControl = null;
     }
 }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        DataManager.instance.InitData();

        DataConfig.MISSION_DIFFICULTY difficulty = DataConfig.MISSION_DIFFICULTY.NORMAL;
        int stageId = 1;

        DataMissionGroup.DataCampaign campaign = DataManager.instance.dataMissionGroup.GetCampaign(difficulty, stageId);
        mapControl = new CampaignMapControl(campaign, 0);

        GameObject camera = GameObject.FindGameObjectWithTag(AppConfig.TAB_MAIN_CAMERA);

        _campaignCamera = camera.GetComponent <CampaignCamera> ();
    }
Ejemplo n.º 4
0
    public void UpdatePageUI(int missionMagicId)
    {
        FreeMapControl();

        DataConfig.MISSION_DIFFICULTY difficulty = DataMission.GetDifficulty(missionMagicId);
        int stageId   = DataMission.GetStageId(missionMagicId);
        int missionId = DataMission.GetMissionId(missionMagicId);

        // TODO 强制战役背景资源 ID 为1
//		stageId = 1;

        DataMissionGroup.DataCampaign campaign = DataManager.instance.dataMissionGroup.GetCampaign(difficulty, stageId);
        mapControl = new CampaignMapControl(campaign, missionId - 1);

        int tileIndex = missionId - 1;

        if (tileIndex >= 0)
        {
            mapControl.SelectTile(tileIndex);
        }
    }