| | |
| | |
|
| | | public partial class ItemConfig : IConfigPostProcess
|
| | | {
|
| | | public static Dictionary<int, ItemConfig> tag_Wings = new Dictionary<int, ItemConfig>();//用来存储所有翅膀所需的Tpye
|
| | | private static Dictionary<int, ItemConfig> m_GemCfgs = new Dictionary<int, ItemConfig>();
|
| | | private const int GEM_TYPE_VALUE = 225;
|
| | |
|
| | |
| | | {
|
| | | m_GemCfgs.Add(EffectValueB1 * 1000 + EffectValueA1, this);
|
| | | }
|
| | | break;
|
| | | case 111:
|
| | | case 39:
|
| | | case 52:
|
| | | tag_Wings.Add(ID, this);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
| | | m_GemCfgs.TryGetValue(level * 1000 + type, out item);
|
| | | return item;
|
| | | }
|
| | |
|
| | | public static bool IsWing(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | return config != null && (config.Type == 111 || config.Type == 39 || config.Type == 52);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 722e5e3d30096674e811f5bd191246a0 |
| | | folderAsset: yes |
| | | timeCreated: 1539228128 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3e05761d690b75440a6be79207d0fb01 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1d70ccd06161e0443b7a802ad94292f8 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 71e878ac60c49ad4f964dd2dbc725739 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: eed34091b0568664b9fb42f0634496c1 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 32ceb8b7faf99f84a8b73ce53c5e3e4d |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 77f69c2b862d1704299a32d0d8eeb71e |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fa14960fa44b0d1439bab471a764e34f |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d914565b65f8e8145988734c4d915834 |
| | | folderAsset: yes |
| | | timeCreated: 1547643019 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | readonly static string PREFAB_EXTERSION = ".prefab";
|
| | | readonly static string SPRITE_EXTERSION = ".png";
|
| | |
|
| | | public static GameObject LoadWindow(string _name)
|
| | | public static GameObject LoadWindow(string name)
|
| | | {
|
| | | GameObject window = null;
|
| | | if (AssetSource.uiFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | var isPriority = PriorityWindowConfig.Get().priorityWindows.Contains(_name);
|
| | | var isPriority = PriorityWindowConfig.Get().priorityWindows.Contains(name);
|
| | |
|
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | isPriority ? ResourcesPath.UI_PRIORITYWINDOW_SUFFIX : ResourcesPath.UI_WINDOW_SUFFIX, "/",
|
| | | _name,
|
| | | name,
|
| | | PREFAB_EXTERSION);
|
| | |
|
| | | window = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var isPriority = PriorityWindowConfig.Get().priorityWindows.Contains(_name);
|
| | | var bundleName = isPriority ? ResourcesPath.UI_PRIORITYWINDOW_SUFFIX.ToLower() : ResourcesPath.UI_WINDOW_SUFFIX.ToLower();
|
| | | var assetInfo = new AssetInfo(bundleName, _name);
|
| | | var isPriority = PriorityWindowConfig.Get().priorityWindows.Contains(name);
|
| | | var bundleName = isPriority ? "ui/prioritywindow" : "ui/window";
|
| | | var assetInfo = new AssetInfo(bundleName, name);
|
| | |
|
| | | window = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject;
|
| | | }
|
| | |
|
| | | if (window == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("UILoader.LoadWindow() => 加载不到资源: {0}.", _name);
|
| | | DebugEx.LogErrorFormat("UILoader.LoadWindow() => 加载不到资源: {0}.", name);
|
| | | }
|
| | |
|
| | | return window;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static GameObject LoadTreasure(string folder, string name)
|
| | | {
|
| | | GameObject prefab = null;
|
| | | if (AssetSource.uiFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "UI/Treasure/", folder, "/",
|
| | | name,
|
| | | PREFAB_EXTERSION);
|
| | |
|
| | | prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | var bundleName = StringUtility.Contact("ui/treasure/", folder).ToLower();
|
| | | var assetInfo = new AssetInfo(bundleName, name);
|
| | |
|
| | | prefab = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject;
|
| | | }
|
| | |
|
| | | if (prefab == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("UILoader.LoadPrefab() => 加载不到资源: {0}.", name);
|
| | | }
|
| | |
|
| | | return prefab;
|
| | | }
|
| | |
|
| | | public static void UnLoadTreasure(string folder, string _assetName)
|
| | | {
|
| | | if (!AssetSource.uiFromEditor)
|
| | | {
|
| | | AssetBundleUtility.Instance.UnloadAsset(StringUtility.Contact("ui/treasure/", folder).ToLower(), _assetName);
|
| | | }
|
| | | }
|
| | |
|
| | | public static GameObject LoadGodWeapon(string _name)
|
| | | {
|
| | | GameObject prefab = null;
|
| | | if (AssetSource.uiFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "UI/Weapon/",
|
| | | _name,
|
| | | PREFAB_EXTERSION);
|
| | |
|
| | | prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | var bundleName = "ui/weapon";
|
| | | var assetInfo = new AssetInfo(bundleName, _name);
|
| | | prefab = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject;
|
| | | }
|
| | |
|
| | | if (prefab == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("UILoader.LoadGodWeapon() => 加载不到资源: {0}.", _name);
|
| | | }
|
| | |
|
| | | return prefab;
|
| | | }
|
| | |
|
| | | public static GameObject LoadBossShow(string _name)
|
| | | {
|
| | | GameObject prefab = null;
|
| | | if (AssetSource.uiFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "UI/BossShow/",
|
| | | _name,
|
| | | PREFAB_EXTERSION);
|
| | |
|
| | | prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | var bundleName = "ui/bossshow";
|
| | | var assetInfo = new AssetInfo(bundleName, _name);
|
| | | prefab = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject;
|
| | | }
|
| | |
|
| | | if (prefab == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("UILoader.LoadBossShow() => 加载不到资源: {0}.", _name);
|
| | | }
|
| | |
|
| | | return prefab;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | GameObjectPoolManager.Instance.CacheGameObject(_prefab, 1, false);
|
| | | _prefab = InstanceResourcesLoader.LoadEffect(_actorShowConfig.uieffect);
|
| | | GameObjectPoolManager.Instance.CacheGameObject(_prefab, 1, false);
|
| | | UILoader.LoadPrefab(_actorShowConfig.cam);
|
| | | UILoader.LoadBossShow(_actorShowConfig.cam);
|
| | |
|
| | | _actorShowConfig = ActorShowConfig.Get(12);
|
| | |
|
| | |
| | | GameObjectPoolManager.Instance.CacheGameObject(_prefab, 1, false);
|
| | | _prefab = InstanceResourcesLoader.LoadEffect(_actorShowConfig.uieffect);
|
| | | GameObjectPoolManager.Instance.CacheGameObject(_prefab, 1, false);
|
| | | UILoader.LoadPrefab(_actorShowConfig.cam);
|
| | | UILoader.LoadBossShow(_actorShowConfig.cam);
|
| | | }
|
| | |
|
| | | public void HandleNewPlayerMission(H0820_tagMissionDict h0820)
|
| | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | | null, null, null); |
| | | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 7, 2, 1); |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 8, 1, 0); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Get", _m_Get_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetKeys", _m_GetKeys_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetValues", _m_GetValues_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Has", _m_Has_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Init", _m_Init_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "GetGemDataByLevelAndType", _m_GetGemDataByLevelAndType_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "IsWing", _m_IsWing_xlua_st_); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "inited", _g_get_inited); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "tag_Wings", _g_get_tag_Wings); |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "tag_Wings", _s_set_tag_Wings); |
| | | |
| | | |
| | | |
| | | Utils.EndClassRegister(type, L, translator); |
| | | } |
| | |
| | | |
| | | ItemConfig gen_ret = ItemConfig.GetGemDataByLevelAndType( _level, _type ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_IsWing_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | int _itemId = LuaAPI.xlua_tointeger(L, 1); |
| | | |
| | | bool gen_ret = ItemConfig.IsWing( _itemId ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_tag_Wings(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.Push(L, ItemConfig.tag_Wings); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_tag_Wings(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | ItemConfig.tag_Wings = (System.Collections.Generic.Dictionary<int, ItemConfig>)translator.GetObject(L, 1, typeof(System.Collections.Generic.Dictionary<int, ItemConfig>)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9a7ec13708152e7428d792e498b67354 |
| | | timeCreated: 1550368559 |
| | | timeCreated: 1550541197 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | | null, null, null); |
| | | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 10, 0, 0); |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 14, 0, 0); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadWindow", _m_LoadWindow_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadWindowAsync", _m_LoadWindowAsync_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "UnLoadWindowAsset", _m_UnLoadWindowAsset_xlua_st_); |
| | |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "UnLoadSprite", _m_UnLoadSprite_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFont", _m_LoadFont_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "UnLoadFont", _m_UnLoadFont_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadTreasure", _m_LoadTreasure_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "UnLoadTreasure", _m_UnLoadTreasure_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadGodWeapon", _m_LoadGodWeapon_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadBossShow", _m_LoadBossShow_xlua_st_); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | string _name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | UnityEngine.GameObject gen_ret = UILoader.LoadWindow( __name ); |
| | | UnityEngine.GameObject gen_ret = UILoader.LoadWindow( _name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_LoadTreasure_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string _folder = LuaAPI.lua_tostring(L, 1); |
| | | string _name = LuaAPI.lua_tostring(L, 2); |
| | | |
| | | UnityEngine.GameObject gen_ret = UILoader.LoadTreasure( _folder, _name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_UnLoadTreasure_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string _folder = LuaAPI.lua_tostring(L, 1); |
| | | string __assetName = LuaAPI.lua_tostring(L, 2); |
| | | |
| | | UILoader.UnLoadTreasure( _folder, __assetName ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_LoadGodWeapon_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | UnityEngine.GameObject gen_ret = UILoader.LoadGodWeapon( __name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_LoadBossShow_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | UnityEngine.GameObject gen_ret = UILoader.LoadBossShow( __name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 76ab9fef6104ded43916de2a746cc1bb |
| | | timeCreated: 1550368559 |
| | | timeCreated: 1550541197 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | private void ActiveBossShowCam(bool _active)
|
| | | {
|
| | | var prefab = UILoader.LoadPrefab(actorShowModel.cam);
|
| | | var prefab = UILoader.LoadBossShow(actorShowModel.cam);
|
| | | if (_active && (actorShowModel.type == 3 || showTargetList.Count > 0))
|
| | | {
|
| | | bossShowCam = UnityEngine.Object.Instantiate<GameObject>(prefab);
|
| | |
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyGrabBossBehaviour : ScrollItem
|
| | | public class FairyGrabBossBehaviour : AutoSelectScrollItem
|
| | | {
|
| | | [SerializeField] AutoSelectCyclicScroll m_Scroll;
|
| | | [SerializeField] SmoothMask m_SmoothMask;
|
| | | [SerializeField] RectTransform m_CenterSign;
|
| | | [SerializeField] RectTransform m_ContainerSelect;
|
| | | [SerializeField] RectTransform m_ContainerKilling;
|
| | | [SerializeField] RectTransform m_ContainerKilled;
|
| | |
| | | [SerializeField] Text m_MapName;
|
| | | [SerializeField] Text m_BossType;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] protected Material m_NormalMaterial;
|
| | | [SerializeField] protected Material m_GrayMaterial;
|
| | | [SerializeField] Image m_RealmIcon;
|
| | | [SerializeField] Text m_Progress;
|
| | | [SerializeField] Button m_Select;
|
| | |
| | |
|
| | | private void SelectBoss()
|
| | | {
|
| | | m_Scroll.TrySelectData(bossId);
|
| | | autoSelectScroll.TrySelectData(bossId);
|
| | | }
|
| | |
|
| | | public override void Display(object _data)
|
| | |
| | | }
|
| | | m_ContainerKilled.gameObject.SetActive(killed && opened);
|
| | | m_ContainerKilling.gameObject.SetActive(!killed && opened);
|
| | | m_BossPortrait.material = opened && !killed ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | | m_BossPortrait.material = opened && !killed ? m_NormalMaterial : m_GrayMaterial;
|
| | | m_ContainerMapName.gameObject.SetActive(!opened);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | protected virtual void LateUpdate()
|
| | | {
|
| | | if (m_Scroll.autoSelectable && model.selectBoss != bossId && bossId > 0)
|
| | | if (autoSelectScroll.autoSelectable && model.selectBoss != bossId && bossId > 0)
|
| | | {
|
| | | if (Mathf.Abs(m_CenterSign.position.y - rectTransform.position.y) * 100f < rectTransform.rect.height * 0.45f)
|
| | | if (Mathf.Abs(centerSign.position.y - rectTransform.position.y) * 100f < rectTransform.rect.height * 0.45f)
|
| | | {
|
| | | model.selectBoss = bossId;
|
| | | }
|
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class FindPreciousBossBriefInfoBehaviour : ScrollItem
|
| | | public class FindPreciousBossBriefInfoBehaviour : AutoSelectScrollItem
|
| | | {
|
| | |
|
| | | [SerializeField] protected float m_SelectedShifting = 6f;
|
| | | [SerializeField] protected CanvasGroup m_CanvasGroup;
|
| | | [SerializeField] protected AutoSelectCyclicScroll m_Scroll;
|
| | | [SerializeField] protected Transform m_CenterSign;
|
| | | [SerializeField] protected Button m_Select;
|
| | | [SerializeField] protected RectTransform m_Content;
|
| | | [SerializeField] protected Image m_BackGround;
|
| | |
| | |
|
| | | private void SelectBoss()
|
| | | {
|
| | | m_Scroll.TrySelectData(bossId);
|
| | | autoSelectScroll.TrySelectData(bossId);
|
| | | }
|
| | |
|
| | | protected virtual void OnSubscribe(int _bossId)
|
| | |
| | |
|
| | | protected virtual void LateUpdate()
|
| | | {
|
| | | if (m_Scroll.autoSelectable && selectedBossId != bossId && bossId > 0)
|
| | | if (autoSelectScroll.autoSelectable && selectedBossId != bossId && bossId > 0)
|
| | | {
|
| | | if (Mathf.Abs(m_CenterSign.position.y - rectTransform.position.y) * 100f < rectTransform.rect.height * 0.45f)
|
| | | if (Mathf.Abs(centerSign.position.y - rectTransform.position.y) * 100f < rectTransform.rect.height * 0.45f)
|
| | | {
|
| | | selectedBossId = bossId;
|
| | | }
|
| | |
| | |
|
| | | foreach (int index in backpack_dic.Keys)
|
| | | {
|
| | | int _id = (int)backpack_dic[index].itemInfo.ItemID;
|
| | | var WingItem = WingRefineExpConfig.Get(_id);
|
| | | if (!ItemConfig.tag_Wings.ContainsKey(_id) || WingItem == null)
|
| | | int itemId = (int)backpack_dic[index].itemInfo.ItemID;
|
| | | if ( !WingRefineExpConfig.Has(itemId)|| !ItemConfig.IsWing(itemId))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | var wingConfig = ItemConfig.tag_Wings[_id];
|
| | | var wingConfig = ItemConfig.Get(itemId);
|
| | | if (wingConfig.Type == 111 && (wingConfig.JobLimit / 100) == _Job)
|
| | | {
|
| | | WingDic.Add(index, backpack_dic[index]);
|
| | |
| | | _dicWings.Clear();
|
| | | foreach (int index in backpack_dic.Keys)
|
| | | {
|
| | | var WingItem = WingRefineExpConfig.Get((int)backpack_dic[index].itemInfo.ItemID);
|
| | | if (ItemConfig.tag_Wings.ContainsKey((int)backpack_dic[index].itemInfo.ItemID) && WingItem != null)
|
| | | var item = backpack_dic[index];
|
| | | var itemId = item.itemInfo.ItemID;
|
| | | if (WingRefineExpConfig.Has(itemId) && ItemConfig.IsWing(itemId))
|
| | | {
|
| | | WingsInformation _WingsInformation = new WingsInformation();
|
| | | _WingsInformation.WingsID = (int)backpack_dic[index].itemInfo.ItemID;
|
| | | _WingsInformation.WingsCount = (int)backpack_dic[index].itemInfo.ItemCount;
|
| | | var _WingsInformation = new WingsInformation();
|
| | | _WingsInformation.WingsID = itemId;
|
| | | _WingsInformation.WingsCount = item.itemInfo.ItemCount;
|
| | | _dicWings.Add(index, _WingsInformation);
|
| | | }
|
| | | }
|
| | |
|
| | | var config1 = WingRefineExpConfig.Get((int)itemModel.itemInfo.ItemID);
|
| | | foreach (var key in _dicWings.Keys)
|
| | | {
|
| | |
| | | foreach (int index in backpack_dic.Keys)
|
| | | {
|
| | | int _id = (int)backpack_dic[index].itemInfo.ItemID;
|
| | | if (!ItemConfig.tag_Wings.ContainsKey(_id))
|
| | | if (!ItemConfig.IsWing(_id))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | var wingConfig = ItemConfig.tag_Wings[_id];
|
| | | var wingConfig = ItemConfig.Get(_id);
|
| | | if (wingConfig.Type == 111 && (wingConfig.JobLimit / 100) == PlayerDatas.Instance.baseData.Job)
|
| | | {
|
| | | markingbbol = true;
|
| | | }
|
| | |
|
| | | }
|
| | | if (markingbbol)
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | Dictionary<int, ItemModel> backpack_Dic = rptItemPack.GetPackModelIndexDict();
|
| | |
|
| | | foreach (int itemIndex in backpack_Dic.Keys)
|
| | | var items = rptItemPack.GetPackModelIndexDict();
|
| | | foreach (var itemIndex in items.Keys)
|
| | | {
|
| | | var WingItem1 = WingRefineExpConfig.Get((int)backpack_Dic[itemIndex].itemInfo.ItemID);
|
| | | if (ItemConfig.tag_Wings.ContainsKey((int)backpack_Dic[itemIndex].itemInfo.ItemID) && WingItem1 != null)
|
| | | var item = items[itemIndex];
|
| | | if (WingRefineExpConfig.Has(item.itemInfo.ItemID))
|
| | | {
|
| | | _wingItemDic.Add(itemIndex, (int)backpack_Dic[itemIndex].itemInfo.ItemID);
|
| | | WingDic.Add(itemIndex, backpack_Dic[itemIndex]);
|
| | | if (ItemConfig.IsWing(item.itemInfo.ItemID))
|
| | | {
|
| | | _wingItemDic.Add(itemIndex, item.itemInfo.ItemID);
|
| | | WingDic.Add(itemIndex, item);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (_wingItemDic.Count != 0)
|
| | | {
|
| | | foreach (var key in _wingItemDic.Keys)
|
| | |
| | | static Vector3 m_CacheBottomScale = Vector3.zero;
|
| | |
|
| | | TreasureModel m_Model;
|
| | | TreasureModel model
|
| | | {
|
| | | get
|
| | | {
|
| | | TreasureModel model {
|
| | | get {
|
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>());
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (paramConfig != null && !paramConfig.treasureNamePrefab.Equals(string.Empty))
|
| | | {
|
| | | var _instance = UILoader.LoadPrefab(paramConfig.treasureNamePrefab);
|
| | | var _instance = UILoader.LoadTreasure("Misc", paramConfig.treasureNamePrefab);
|
| | | if (_instance != null)
|
| | | {
|
| | | _instance = GameObject.Instantiate(_instance);
|
| | |
| | | GameObjectPoolManager.GameObjectPool _pool = null;
|
| | | if (!m_BottomPoolDict.TryGetValue(category, out _pool))
|
| | | {
|
| | | var _bottomPrefab = UILoader.LoadPrefab(StringUtility.Contact("TreasureBottom_", category));
|
| | | var _bottomPrefab = UILoader.LoadTreasure("Misc", StringUtility.Contact("TreasureBottom_", category));
|
| | | m_CacheBottomScale = _bottomPrefab.transform.localScale;
|
| | | _pool = GameObjectPoolManager.Instance.RequestPool(_bottomPrefab);
|
| | | m_BottomPoolDict.Add(category, _pool);
|
| | |
| | | RecycleTreasureEffect();
|
| | | RequestLockEffect();
|
| | | }
|
| | | if (UI3DTreasureSelectStage.Instance.CloserComplete |
| | | if (UI3DTreasureSelectStage.Instance.CloserComplete
|
| | | && UI3DTreasureSelectStage.Instance.selectTreasure == treasureId)
|
| | | {
|
| | | CloserState();
|
| | |
| | | return;
|
| | | }
|
| | | bool _update = false;
|
| | | if(_treasure.skillLevelUpRedpoint.id==_id
|
| | | if (_treasure.skillLevelUpRedpoint.id == _id
|
| | | || _treasure.achievementRedpoint.id == _id)
|
| | | {
|
| | | _update = true;
|
| | | }
|
| | | if(_treasure is HumanTreasure)
|
| | | if (_treasure is HumanTreasure)
|
| | | {
|
| | | var _human = _treasure as HumanTreasure;
|
| | | if(_human.castSoulRedpoint.id==_id)
|
| | | if (_human.castSoulRedpoint.id == _id)
|
| | | {
|
| | | _update = true;
|
| | | }
|
| | |
| | | GameObjectPoolManager.GameObjectPool pool;
|
| | | if (m_ConditionPoolDict.TryGetValue(category, out pool) == false)
|
| | | {
|
| | | var _prefab = UILoader.LoadPrefab(StringUtility.Contact(category, "TreasureCondition"));
|
| | | var _prefab = UILoader.LoadTreasure("Misc", StringUtility.Contact(category, "TreasureCondition"));
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(_prefab);
|
| | | m_ConditionPoolDict.Add(category, pool);
|
| | | }
|
| | |
| | | GameObjectPoolManager.GameObjectPool pool;
|
| | | if (m_LabelPoolDict.TryGetValue(category, out pool) == false)
|
| | | {
|
| | | var _prefab = UILoader.LoadPrefab(StringUtility.Contact(category, "TreasureLabel"));
|
| | | var _prefab = UILoader.LoadTreasure("Misc", StringUtility.Contact(category, "TreasureLabel"));
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(_prefab);
|
| | | m_LabelPoolDict.Add(category, pool);
|
| | | }
|
| | |
| | | }
|
| | | if (m_TreasureCanvaPool == null)
|
| | | {
|
| | | var prefab = UILoader.LoadPrefab("TreasureCanva");
|
| | | var prefab = UILoader.LoadTreasure("Misc", "TreasureCanva");
|
| | | if (prefab)
|
| | | {
|
| | | m_TreasureCanvaPool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | |
| | | {
|
| | | if (m_Instance == null)
|
| | | {
|
| | | var gameObject = Instantiate(UILoader.LoadPrefab("UI3DTreasureSelectStage"));
|
| | | var gameObject = Instantiate(UILoader.LoadTreasure("Misc","UI3DTreasureSelectStage"));
|
| | | m_Instance = gameObject.GetComponent<UI3DTreasureSelectStage>();
|
| | | m_Instance.transform.position = new Vector3(0, 3000, 4000);
|
| | | m_Instance.name = "UI3DTreasureSelectStage";
|
| | |
| | | |
| | | public class AutoSelectCyclicScroll : CyclicScroll |
| | | { |
| | | public bool autoSelectable |
| | | { |
| | | |
| | | [SerializeField] RectTransform m_CenterSign; |
| | | |
| | | public bool autoSelectable { |
| | | get { return Time.time > allowSelectTime; } |
| | | } |
| | | |
| | |
| | | public override void ReArrange() |
| | | { |
| | | base.ReArrange(); |
| | | |
| | | foreach (var item in infiniteItems) |
| | | { |
| | | var autoSelectItem = item as AutoSelectScrollItem; |
| | | if (autoSelectItem != null) |
| | | { |
| | | autoSelectItem.autoSelectScroll = this; |
| | | autoSelectItem.centerSign = m_CenterSign; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class AutoSelectScrollItem : ScrollItem |
| | | { |
| | | public AutoSelectCyclicScroll autoSelectScroll { get; set; } |
| | | public RectTransform centerSign { get; set; } |
| | | |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6ae9f97e721931f4585e010e53f47a5b |
| | | timeCreated: 1497924839 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public class CyclicScroll : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
| | | {
|
| | | [SerializeField] RectTransform m_Content;
|
| | | public RectTransform content {
|
| | | get { return m_Content; }
|
| | | }
|
| | | public RectTransform content { get { return m_Content; } }
|
| | |
|
| | | [SerializeField] protected BoundOffset m_BoundOffset;
|
| | | [SerializeField] protected Vector2 m_CellSize = new Vector2(100, 100);
|
| | | public Vector2 cellSize {
|
| | | get { return m_CellSize; }
|
| | | }
|
| | | public Vector2 cellSize { get { return m_CellSize; } }
|
| | |
|
| | | [SerializeField] protected Vector2 m_Spacing;
|
| | | public Vector2 spacing {
|
| | | get { return m_Spacing; }
|
| | | }
|
| | | public Vector2 spacing { get { return m_Spacing; } }
|
| | |
|
| | | [SerializeField] Align m_Align = Align.Top;
|
| | | public Align align {
|
| | | get { return m_Align; }
|
| | | }
|
| | | public Align align { get { return m_Align; } }
|
| | |
|
| | | [SerializeField] bool m_ElasticityOn = true;
|
| | | public bool elasticityOn {
|
| | | get { return m_ElasticityOn; }
|
| | | }
|
| | | public bool elasticityOn { get { return m_ElasticityOn; } }
|
| | |
|
| | | [SerializeField] private float m_Elasticity = 0.1f;
|
| | | public float elasticity {
|
| | | get {
|
| | | return m_Elasticity;
|
| | | }
|
| | | }
|
| | | public float elasticity { get { return m_Elasticity; } }
|
| | |
|
| | | [SerializeField] private float m_DecelerationRate = 0.135f;
|
| | | public float decelerationRate {
|
| | | get {
|
| | | return m_DecelerationRate;
|
| | | }
|
| | | }
|
| | | public float decelerationRate { get { return m_DecelerationRate; } }
|
| | |
|
| | | [SerializeField] string m_ChildPrefabName = string.Empty;
|
| | | [SerializeField] string m_ChildDisplayName = string.Empty;
|
| | | [SerializeField] int m_ChildCount = 5;
|
| | |
|
| | | public float normalizedPosition {
|
| | | get {
|
| | |
| | | get; set;
|
| | | }
|
| | |
|
| | | public virtual void Init<T>( List<T> _datas, bool _stepByStep = false)
|
| | | public virtual void Init<T>(List<T> _datas, bool _stepByStep = false)
|
| | | {
|
| | | if (_datas == null)
|
| | | {
|
| | |
| | | {
|
| | | velocity = 0f;
|
| | | autoLerp = false;
|
| | | CreateElements();
|
| | | ElementsMatch();
|
| | | Arrange(align);
|
| | | }
|
| | |
|
| | | private void FillBatchData(int _startIndex)
|
| | | private void CreateElements()
|
| | | {
|
| | | int min = Mathf.Min(infiniteItems.Count, dataCount);
|
| | | preIndex = Mathf.Clamp(_startIndex, 0, dataCount - min);
|
| | | hostIndex = preIndex + min - 1;
|
| | |
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | var items = this.content.GetComponentsInChildren<ScrollItem>(true);
|
| | | if (items.Length < m_ChildCount)
|
| | | {
|
| | | var item = infiniteItems[i];
|
| | | if (i <= hostIndex - preIndex)
|
| | | var dif = m_ChildCount - items.Length;
|
| | | if (!string.IsNullOrEmpty(m_ChildPrefabName) && !string.IsNullOrEmpty(m_ChildDisplayName))
|
| | | {
|
| | | item.gameObject.SetActive(true);
|
| | | item.Display(datas[preIndex + i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | item.gameObject.SetActive(false);
|
| | | item.Dispose();
|
| | | for (var i = 0; i < dif; i++)
|
| | | {
|
| | | var instance = UIUtility.CreateWidget(m_ChildPrefabName, m_ChildDisplayName);
|
| | | instance.transform.SetParentEx(this.m_Content, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | content.anchoredPosition = Vector2.zero;
|
| | | }
|
| | |
|
| | | private void FillBatchData(int _startIndex)
|
| | | {
|
| | | int min = Mathf.Min(infiniteItems.Count, dataCount);
|
| | | preIndex = Mathf.Clamp(_startIndex, 0, dataCount - min);
|
| | | hostIndex = preIndex + min - 1;
|
| | |
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | {
|
| | | var item = infiniteItems[i];
|
| | | if (i <= hostIndex - preIndex)
|
| | | {
|
| | | item.gameObject.SetActive(true);
|
| | | item.Display(datas[preIndex + i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | item.gameObject.SetActive(false);
|
| | | item.Dispose();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private Vector2 CalculateElementOffset(Align _align)
|
| | | {
|
| | | switch (_align)
|
| | |
| | | using UnityEngine.UI;
|
| | | using System;
|
| | |
|
| | | public class ScrollItem:MonoBehaviour {
|
| | | public class ScrollItem : MonoBehaviour
|
| | | {
|
| | |
|
| | | RectTransform m_RectTransform;
|
| | | public RectTransform rectTransform {
|
| | | get {
|
| | | if(m_RectTransform == null) {
|
| | | if (m_RectTransform == null)
|
| | | {
|
| | | m_RectTransform = this.AddMissingComponent<RectTransform>();
|
| | | }
|
| | | return m_RectTransform;
|
| | | }
|
| | | }
|
| | |
|
| | | public virtual void Display(object _data) {
|
| | | public virtual void Display(object _data)
|
| | | {
|
| | | this.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | public virtual void Dispose() {
|
| | | public virtual void Dispose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | |
| | | get {
|
| | | if (m_Instance == null)
|
| | | {
|
| | | var gameObject = Instantiate(UILoader.LoadPrefab("UI3DHeroSkillShow"));
|
| | | var gameObject = Instantiate(UILoader.LoadTreasure("Misc", "UI3DHeroSkillShow"));
|
| | | m_Instance = gameObject.GetComponent<UI3DHeroSkillShow>();
|
| | | Instance.transform.position = new Vector3(0, 4000, 5000);
|
| | | m_Instance.name = "UI3DHeroSkillShow";
|
| | |
| | | if (instance == null)
|
| | | {
|
| | | var config = TreasureConfig.Get(_id);
|
| | | var prefab = UILoader.LoadPrefab(config.Model);
|
| | | var folder = string.Empty;
|
| | | switch ((TreasureCategory)config.Category)
|
| | | {
|
| | | case TreasureCategory.Human:
|
| | | folder = "RenZu";
|
| | | break;
|
| | | case TreasureCategory.Demon:
|
| | | folder = "MoZu";
|
| | | break;
|
| | | case TreasureCategory.Fairy:
|
| | | folder = "XianZu";
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | var prefab = UILoader.LoadTreasure(folder, config.Model);
|
| | | instance = GameObject.Instantiate(prefab);
|
| | | treasureModels[_id] = instance;
|
| | |
|
| | | UILoader.UnLoadPrefab(config.Model);
|
| | | UILoader.UnLoadTreasure(folder, config.Model);
|
| | | }
|
| | |
|
| | | var animator = instance.GetComponent<Animator>();
|
| | |
| | |
|
| | | public static GameObject LoadUIGodWeapon(int _type)
|
| | | {
|
| | | var prefab = UILoader.LoadPrefab(GeneralDefine.godWeaponMobs[_type]);
|
| | | var prefab = UILoader.LoadGodWeapon(GeneralDefine.godWeaponMobs[_type]);
|
| | | var pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | var model = pool.Request();
|
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | var prefab = UILoader.LoadPrefab(GeneralDefine.godWeaponMobs[_type]);
|
| | | var prefab = UILoader.LoadGodWeapon(GeneralDefine.godWeaponMobs[_type]);
|
| | | var pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | |
|
| | | var animator = _model.GetComponent<Animator>();
|