| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | 
							- using System;
 
- using System.Collections.Generic;
 
- using ET;
 
- using GFGGame;
 
- namespace GFGGame
 
- {
 
-     public class StudioDataManager : SingletonBase<StudioDataManager>
 
-     {
 
-         private Dictionary<int, StudioData> _StudioInfoById = new Dictionary<int, StudioData>();
 
-         public int TYPE_SELECT_INDEX = 0;//界面类型0无属性选择,1有属性选择
 
-         public int PROPERTY_SELECT_INDEX = 0;//属性类型
 
-         public string VIEW_NAME = "";//界面名称
 
-         public void Clear()
 
-         {
 
-             _StudioInfoById.Clear();
 
-         }
 
-         public void RspStudioInfos(StudioData studioData)
 
-         {
 
-             if (!_StudioInfoById.ContainsKey(studioData.ChapterId))
 
-             {
 
-                 _StudioInfoById.Add(studioData.ChapterId, studioData);
 
-             }
 
-             _StudioInfoById[studioData.ChapterId] = studioData;
 
-         }
 
-         public void RspBuyStudioPlayTimes(int chapterId, int buyTimes, int totalPlayTimes)
 
-         {
 
-             _StudioInfoById[chapterId].BuyTimes = buyTimes;
 
-             _StudioInfoById[chapterId].TotalPlayTimes = totalPlayTimes;
 
-         }
 
-         public void NoticeStudioPlayTimes(M2C_NoticeStudioPlayTimes message)
 
-         {
 
-             _StudioInfoById[message.ChapterId].PlayTimes = message.PlayTimes;
 
-         }
 
-         public StudioData GetStudioDataById(int id)
 
-         {
 
-             if (_StudioInfoById.ContainsKey(id))
 
-             {
 
-                 return _StudioInfoById[id];
 
-             }
 
-             else
 
-             {
 
-                 StudioData studioData = new StudioData() { ChapterId = id, BuyTimes = 0, PlayTimes = 0, TotalPlayTimes = StudioCfgArray.Instance.GetCfg(id).num };
 
-                 RspStudioInfos(studioData);
 
-                 return studioData;
 
-             }
 
-         }
 
-         public void IsCanFight(List<StoryLevelCfg> storyLevelCfgs, int index, out bool canFight, out string content)
 
-         {
 
-             StoryLevelCfg storyLevelCfg = storyLevelCfgs[index];
 
-             bool isPass = InstanceZonesDataManager.CheckLevelPass(storyLevelCfg.needStoryLevelId);
 
-             bool isRoleLv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= storyLevelCfg.needRoleLv;
 
-             bool isLastPast = true;
 
-             if (index > 0)
 
-             {
 
-                 isLastPast = InstanceZonesDataManager.CheckLevelPass(storyLevelCfgs[index - 1].id);
 
-             }
 
-             content = "";
 
-             if (!isRoleLv) content = string.Format("主角等级达到{0}级解锁", storyLevelCfg.order);
 
-             if (!isLastPast) content = string.Format("需通关{0}", storyLevelCfgs[index - 1].name);
 
-             StoryLevelCfg needStoryLevelCfg = StoryLevelCfgArray.Instance.GetCfg(storyLevelCfg.needStoryLevelId);
 
-             if (!isPass) content = string.Format("完成主线{0}-{1}解锁", needStoryLevelCfg.chapterId, needStoryLevelCfg.order);
 
-             canFight = isPass && isRoleLv && isLastPast;
 
-         }
 
-         public void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
 
-         {
 
-             ViewManager.Show(VIEW_NAME, new object[] { TYPE_SELECT_INDEX, PROPERTY_SELECT_INDEX }, ViewManager.GetGoBackDatas(VIEW_NAME));
 
-         }
 
-     }
 
- }
 
 
  |