Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | private static Dictionary<string, List<StoreConfig>> s_canBuyShopDict = new Dictionary<string, List<StoreConfig>>(); //用于存储可以购买的商品
|
| | | private static Dictionary<StoreItem, StoreConfig> s_StoreItemDict = new Dictionary<StoreItem, StoreConfig>();
|
| | | private static Dictionary<int, List<StoreConfig>> s_TheOnlyShopDict = new Dictionary<int, List<StoreConfig>>(); //key 唯一商品的物品id
|
| | |
|
| | | private static Dictionary<int, List<StoreConfig>> storeConfigs = new Dictionary<int, List<StoreConfig>>();
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (!s_storeModelDict.ContainsKey(ShopType))
|
| | |
| | | {
|
| | | s_StoreItemDict.Add(_storeItem, this);
|
| | | }
|
| | |
|
| | | List<StoreConfig> list = null;
|
| | | if(!storeConfigs.TryGetValue(ShopType,out list))
|
| | | {
|
| | | list = new List<StoreConfig>();
|
| | | storeConfigs.Add(ShopType, list);
|
| | | }
|
| | | list.Add(this);
|
| | | }
|
| | |
|
| | | private static List<StoreConfig> modellist = new List<StoreConfig>();
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static bool TryGetStoreConfigs(int shopType, out List<StoreConfig> list)
|
| | | {
|
| | | return storeConfigs.TryGetValue(shopType, out list);
|
| | | }
|
| | |
|
| | | public struct StoreItem
|
| | | {
|
| | | public int item;
|
| | |
| | | public SDKUtility.FP_LoginOk sdkLoginResult;
|
| | | public SDKUtility.FP_CheckIDAuthentication sdkIDCheckIDAuthentication;
|
| | |
|
| | | public string localSaveAccountName
|
| | | {
|
| | | public string localSaveAccountName {
|
| | | get { return LocalSave.GetString(USER_ACCOUNT); }
|
| | | set { LocalSave.SetString(USER_ACCOUNT, value); }
|
| | | }
|
| | |
| | | public event Action accountBindOkEvent;
|
| | |
|
| | | bool m_ReconnecBackGround = false;
|
| | | public bool reconnectBackGround
|
| | | {
|
| | | public bool reconnectBackGround {
|
| | | get { return m_ReconnecBackGround; }
|
| | | set { m_ReconnecBackGround = value; }
|
| | | }
|
| | |
|
| | | bool m_OnCreateRole = false;
|
| | | public bool onCreateRole
|
| | | {
|
| | | public bool onCreateRole {
|
| | | get { return m_OnCreateRole; }
|
| | | set { m_OnCreateRole = value; }
|
| | | }
|
| | |
|
| | | bool m_Busy = false;
|
| | | public bool busy
|
| | | {
|
| | | public bool busy {
|
| | | get { return m_Busy; }
|
| | | set { m_Busy = value; }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | busy = true;
|
| | |
|
| | | try
|
| | | {
|
| | | reconnectBackGround = false;
|
| | | accountBuf = _account;
|
| | | localSaveAccountName = accountBuf;
|
| | |
| | |
|
| | | GameNetSystem.Instance.OnAccountLogin();
|
| | | NetLinkWin.Show();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | busy = false;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void AccountLogin(string _ip, int _port, int _gamePort)
|
| | |
| | | busy = true;
|
| | | reconnectBackGround = true;
|
| | |
|
| | | try
|
| | | {
|
| | | ConnectGameServer(ipBuf, gamePortBuf);
|
| | |
|
| | | NetLinkWin.Show();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | busy = false;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnAccountLogin(bool _ok, string _result)
|
| | |
| | | }
|
| | |
|
| | | localSaveAccountName = accountBuf;
|
| | | try
|
| | | {
|
| | | ConnectGameServer(ipBuf, gamePortBuf);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | busy = false;
|
| | | Debug.Log(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | void ConnectGameServer(string _ip, int _port)
|
| | | {
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | var _list = StoreConfig.GetTypeStoreModel((int)StoreFunc.OSGift);
|
| | | List<StoreConfig> _list = null;
|
| | | StoreConfig.TryGetStoreConfigs((int)StoreFunc.OSGift,out _list);
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | var _limit = storeModel.GetBuyShopLimit((uint)_list[i].ID);
|
| | |
| | |
|
| | | private void Display()
|
| | | {
|
| | | var _list = StoreConfig.GetTypeStoreModel((int)StoreFunc.OSGift, true);
|
| | | List<StoreConfig> _list = null;
|
| | | StoreConfig.TryGetStoreConfigs((int)StoreFunc.OSGift, out _list);
|
| | | var _index = 0;
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | |
| | |
|
| | | int cacheRealmPoint = 0;
|
| | | Coroutine cacheCoroutine = null;
|
| | | RuntimeAnimatorController cacheController = null;
|
| | | const string State_EnterHash = "Show";
|
| | | const string State_IdleHash = "Idle";
|
| | |
|
| | |
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | if (cacheController != null)
|
| | | {
|
| | | cacheController = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | IEnumerator Co_DisplayBossShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS800;
|
| | | ResetRunTimeController();
|
| | | var config = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | |
| | | {
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | ResetRunTimeController();
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | StartBoss(config);
|
| | | }
|
| | |
| | |
|
| | | private void StopBoss()
|
| | | {
|
| | | ResetRunTimeController();
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | }
|
| | |
|
| | | private void ResetRunTimeController()
|
| | | {
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | if (npcModel != null)
|
| | | {
|
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null && cacheController != null)
|
| | | {
|
| | | animator.runtimeAnimatorController = cacheController;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void StartBoss(RealmConfig config, bool act = false)
|
| | |
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null)
|
| | | {
|
| | | cacheController = animator.runtimeAnimatorController;
|
| | | var runtimeController = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerRealmSuffix, npcConfig.MODE);
|
| | | animator.runtimeAnimatorController = runtimeController;
|
| | | animator.Play(act ? State_EnterHash : State_IdleHash, 0);
|
| | |
| | |
|
| | | var config = Config.Instance.Get<TreasureConfig>(treasure.id);
|
| | | m_TreasureName.text = config.Name;
|
| | | m_Story.text = config.Story;
|
| | | m_Category.text = Language.Get(string.Concat("GetTreasure_", config.Category));
|
| | | if ((TreasureCategory)config.Category == TreasureCategory.Human)
|
| | | {
|
| | |
| | | public override void Init()
|
| | | {
|
| | | var _openDay = 0;
|
| | | var _list = StoreConfig.GetTypeStoreModel((int)StoreFunc.OSTimeLimitGift);
|
| | | List<StoreConfig> _list = null;
|
| | | StoreConfig.TryGetStoreConfigs((int)StoreFunc.OSTimeLimitGift, out _list);
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | List<StoreConfig> _configs = null;
|
| | |
| | | var animator = model.GetComponent<Animator>();
|
| | | if (animator != null)
|
| | | {
|
| | | ResetRealmBossAnimator(id, animator);
|
| | | animator.enabled = false;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private static void ResetRealmBossAnimator(int _id, Animator animator)
|
| | | {
|
| | | var configs = Config.Instance.GetAllValues<RealmConfig>();
|
| | | var index = configs.FindIndex((x) =>
|
| | | {
|
| | | return x.BossID == _id;
|
| | | });
|
| | | if (index != -1)
|
| | | {
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(_id);
|
| | | if (npcConfig != null)
|
| | | {
|
| | | var runtimeController = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix, npcConfig.MODE);
|
| | | if (runtimeController != null)
|
| | | {
|
| | | animator.runtimeAnimatorController = runtimeController;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public static GameObject LoadUIHorse(int id)
|
| | | {
|
| | | var prefab = InstanceResourcesLoader.LoadModelRes(id);
|