Merge branch 'master' into leonard
# Conflicts:
# Core/Config/AssetSource.cs
# System/WindowBase/WindowCenter.cs
| | |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public class AssetSource
|
| | | public class AssetSource |
| | | { |
| | | |
| | | public static bool allFromEditor {
|
| | | get {
|
| | | return audioFromEditor && effectFromEditor && mobFromEditor && refdataFromEditor && sceneFromEditor && shaderFromEditor && uiFromEditor;
|
| | | }
|
| | | set {
|
| | | audioFromEditor = value;
|
| | | effectFromEditor = value;
|
| | | mobFromEditor = value;
|
| | | refdataFromEditor = value;
|
| | | shaderFromEditor = value;
|
| | | sceneFromEditor = value;
|
| | | uiFromEditor = value;
|
| | | }
|
| | | }
|
| | |
|
| | | public static bool allFromEditor { |
| | | get { |
| | | return audioFromEditor |
| | | && effectFromEditor |
| | | && mobFromEditor |
| | | && refdataFromEditor |
| | | && sceneFromEditor |
| | | && shaderFromEditor |
| | | && uiFromEditor |
| | | && builtInFromEditor; |
| | | } |
| | | set { |
| | | audioFromEditor = value; |
| | | effectFromEditor = value; |
| | | mobFromEditor = value; |
| | | refdataFromEditor = value; |
| | | shaderFromEditor = value; |
| | | sceneFromEditor = value; |
| | | uiFromEditor = value; |
| | | builtInFromEditor = value; |
| | | } |
| | | } |
| | | |
| | | static bool m_AudioFromEditor = false; |
| | | public static bool audioFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_AudioFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_AudioFromEditor", value);
|
| | | #else
|
| | | m_AudioFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | public static bool audioFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_AudioFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_AudioFromEditor", value); |
| | | #else |
| | | m_AudioFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_EffectFromEditor = false; |
| | | public static bool effectFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_EffectFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_EffectFromEditor", value);
|
| | | #else
|
| | | m_AudioFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | static bool m_MobFromEditor = false;
|
| | | public static bool mobFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_MobFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_MobFromEditor", value);
|
| | | #else
|
| | | m_MobFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | public static bool effectFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_EffectFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_EffectFromEditor", value); |
| | | #else |
| | | m_AudioFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_MobFromEditor = false; |
| | | public static bool mobFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_MobFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_MobFromEditor", value); |
| | | #else |
| | | m_MobFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_RefdataFromEditor = false; |
| | | public static bool refdataFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_RefdataFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_RefdataFromEditor", value);
|
| | | #else
|
| | | m_RefdataFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | public static bool refdataFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_RefdataFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_RefdataFromEditor", value); |
| | | #else |
| | | m_RefdataFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_SceneFromEditor = false; |
| | | public static bool sceneFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_SceneFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_SceneFromEditor", value);
|
| | | #else
|
| | | m_SceneFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | static bool m_ShaderFromEditor = false;
|
| | | public static bool shaderFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_ShaderFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_ShaderFromEditor", value);
|
| | | #else
|
| | | m_ShaderFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | static bool m_UIFromEditor = false;
|
| | | public static bool uiFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_UIFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_UIFromEditor", value);
|
| | | #else
|
| | | m_UIFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | static bool m_LuaFromEditor = false;
|
| | | public static bool luaFromEditor {
|
| | | get {
|
| | | #if UNITY_EDITOR
|
| | | return LocalSave.GetBool("Asset_LuaFromEditor", true);
|
| | | #else
|
| | | return false;
|
| | | #endif
|
| | | }
|
| | | set {
|
| | | #if UNITY_EDITOR
|
| | | LocalSave.SetBool("Asset_LuaFromEditor", value);
|
| | | #else
|
| | | m_LuaFromEditor=value;
|
| | | #endif
|
| | | }
|
| | | }
|
| | | public static bool sceneFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_SceneFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_SceneFromEditor", value); |
| | | #else |
| | | m_SceneFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_ShaderFromEditor = false; |
| | | public static bool shaderFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_ShaderFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_ShaderFromEditor", value); |
| | | #else |
| | | m_ShaderFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_UIFromEditor = false; |
| | | public static bool uiFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_UIFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_UIFromEditor", value); |
| | | #else |
| | | m_UIFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_BuiltInFromEditor = false; |
| | | public static bool builtInFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_BuiltInFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_BuiltInFromEditor", value); |
| | | #else |
| | | m_BuiltInFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_LuaFromEditor = false; |
| | | public static bool luaFromEditor { |
| | | get { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_LuaFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_LuaFromEditor", value); |
| | | #else |
| | | m_LuaFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | } |
| | |
| | | EditorApplication.delayCall += ExcuteBuildUI;
|
| | | }
|
| | |
|
| | | if (GUILayout.Button("BuiltIn"))
|
| | | {
|
| | | EditorApplication.delayCall += ExcuteBuildBuiltIn;
|
| | | }
|
| | |
|
| | | if (GUILayout.Button("Audio"))
|
| | | {
|
| | | EditorApplication.delayCall += ExcuteBuildAudio;
|
| | |
| | |
|
| | | EditorGUILayout.Space();
|
| | | GUILayout.BeginHorizontal();
|
| | |
|
| | | ClientPackage.obfuscatorEnabled = EditorGUILayout.Toggle("obfuscator enable ", ClientPackage.obfuscatorEnabled);
|
| | |
|
| | | #if UNITY_ANDROID
|
| | | if (GUILayout.Button("APK"))
|
| | |
| | | ExcuteBuildLevels();
|
| | | ExcuteBuildGraphic();
|
| | | ExcuteBuildUI();
|
| | | ExcuteBuildBuiltIn();
|
| | |
|
| | | AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);
|
| | |
|
| | |
| | | AssetBundleBuildExtersion.Build(outputPath, _category, opt, (BuildTarget)m_UserData.m_BuildTarget);
|
| | | }
|
| | |
|
| | | private void ExcuteBuildBuiltIn()
|
| | | {
|
| | | BuiltInResourceSetting.SetLaunchBackGround(publishers.Split('|')[0], (BuildTarget)m_UserData.m_BuildTarget);
|
| | | BuiltInResourceSetting.SetLoginBackGround(publishers.Split('|')[0], (BuildTarget)m_UserData.m_BuildTarget);
|
| | | BuiltInResourceSetting.SetLoginLogo(publishers.Split('|')[0], (BuildTarget)m_UserData.m_BuildTarget);
|
| | | ExcuteBuildAsset("builtin");
|
| | | }
|
| | |
|
| | | private void ExcuteBuildAudio()
|
| | | {
|
| | | UpdateAudioSetting.SetAllAudioAssetBundleName();
|
| | |
| | | {
|
| | | UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
|
| | | ExcuteBuildAsset("config");
|
| | | TableTool.ReadAllTxtToBytes(StringUtility.Contact(m_UserData.m_OutputPath, "/config"));
|
| | | TableTool.CopyConfigsToOutPutPath(StringUtility.Contact(m_UserData.m_OutputPath, "/config"));
|
| | | }
|
| | |
|
| | | private void ExcuteBuildLevels()
|
| | |
| | |
|
| | | Register(typeof(HAA19_tagMCActWishingWellInfo), typeof(DTCAA19_tagMCActWishingWellInfo));
|
| | | Register(typeof(HAA1A_tagMCActWishingWellPlayerInfo), typeof(DTCAA1A_tagMCActWishingWellPlayerInfo));
|
| | | Register(typeof(HAA1B_tagMCActWishingDragResult), typeof(DTCAA1B_tagMCActWishingDragResult));
|
| | | }
|
| | |
|
| | | private static void Register(Type _pack, Type _business)
|
| | |
| | | Screen.sleepTimeout = SleepTimeout.NeverSleep;
|
| | |
|
| | | ShaderUtility.InitGlobalParams();
|
| | |
|
| | | SoundPlayer.CreateSoundPlayer();
|
| | | SoundPlayer.Instance.PlayLoginMusic();
|
| | |
|
| | | SystemSetting.Instance.SetSoundVolume(SystemSetting.Instance.GetSoundVolume());
|
| | | SystemSetting.Instance.SetSoundEffect(SystemSetting.Instance.GetSoundEffect());
|
| | | SystemSetting.Instance.SetGameFps(SystemSetting.Instance.GetGameFps());
|
| | |
| | | DebugUtility.Instance.Init();
|
| | | GlobalTimeEvent.Instance.Begin();
|
| | |
|
| | | #if UNITY_ANDROID && !UNITY_EDITOR
|
| | | if (!SDKUtility.builtinAssetCopyFinished)
|
| | | {
|
| | | SDKUtility.Instance.CopyOneAsset("builtin_assetbundle");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin_assetbundle.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/music");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/music.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/prefabs");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/prefabs.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/sprite");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/sprite.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("config/Contact.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("config/HelpInfo.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("config/PriorBundle.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("config/PriorLanguage.txt");
|
| | |
|
| | | LocalSave.SetString("BuiltInAssetCopyCompleted_Android", VersionConfig.Get().version);
|
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | if (!VersionUtility.Instance.InIosAuditTime())
|
| | | {
|
| | | if (!SDKUtility.builtinAssetCopyFinished)
|
| | | {
|
| | | var targetDirectory = ResourcesPath.Instance.ExternalStorePath;
|
| | | if (!Directory.Exists(targetDirectory))
|
| | | {
|
| | | Directory.CreateDirectory(targetDirectory);
|
| | | }
|
| | |
|
| | | var fileNames = new List<string>();
|
| | | var files = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(ResourcesPath.Instance.StreamingAssetPath, "builtin"), files);
|
| | | foreach (var file in files)
|
| | | {
|
| | | var name = Path.GetFileName(file.FullName);
|
| | | fileNames.Add(StringUtility.Contact("builtin", Path.DirectorySeparatorChar, name));
|
| | | }
|
| | |
|
| | | fileNames.Add("builtin_assetbundle");
|
| | | fileNames.Add("builtin_assetbundle.manifest");
|
| | |
|
| | | var configFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(ResourcesPath.Instance.StreamingAssetPath, "config"), configFiles);
|
| | | foreach (var file in configFiles)
|
| | | {
|
| | | var name = Path.GetFileName(file.FullName);
|
| | | fileNames.Add(StringUtility.Contact("config", Path.DirectorySeparatorChar, name));
|
| | | }
|
| | |
|
| | | foreach (var item in fileNames)
|
| | | {
|
| | | var fromPath = StringUtility.Contact(ResourcesPath.Instance.StreamingAssetPath, item);
|
| | | var toPath = StringUtility.Contact(targetDirectory, item);
|
| | |
|
| | | var destDirectoryName = Path.GetDirectoryName(toPath);
|
| | | if (!Directory.Exists(destDirectoryName))
|
| | | {
|
| | | Directory.CreateDirectory(destDirectoryName);
|
| | | }
|
| | |
|
| | | File.Copy(fromPath, toPath, true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | LocalSave.SetString("BuiltInAssetCopyCompleted_IOS", VersionConfig.Get().version);
|
| | | #endif
|
| | |
|
| | | if (!AssetSource.builtInFromEditor)
|
| | | {
|
| | | AssetBundleUtility.Instance.InitBuiltInAsset();
|
| | | }
|
| | | }
|
| | |
|
| | | void Start()
|
| | | {
|
| | | SoundPlayer.Instance.PlayLoginMusic();
|
| | | Config.Instance.PreLoadConfigs();
|
| | | ServerListCenter.Instance.RequestJumpUrl();
|
| | |
|
| | |
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS |
| | | #if UNITY_IOS
|
| | | if (!VersionUtility.Instance.InIosAuditTime())
|
| | | {
|
| | | m_CurrentStage = LaunchStage.ClientVersion;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Monday, October 15, 2018 |
| | | // [ Date ]: Thursday, October 25, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public partial class ContactConfig : ConfigBase { |
| | | |
| | | public int id { get ; private set ; } |
| | | public string appid { get ; private set; } |
| | | public int branch { get ; private set ; } |
| | | public string qq { get ; private set; } |
| | | public string phone { get ; private set; } |
| | | |
| | | public override string getKey() |
| | | { |
| | | return appid.ToString(); |
| | | return id.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | appid = rawContents[0].Trim(); |
| | | id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | qq = rawContents[1].Trim(); |
| | | appid = rawContents[1].Trim(); |
| | | |
| | | phone = rawContents[2].Trim(); |
| | | branch=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | qq = rawContents[3].Trim(); |
| | | |
| | | phone = rawContents[4].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8ecbb84f62ba262448b74256777f91ec |
| | | timeCreated: 1539586414 |
| | | timeCreated: 1540450970 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, July 31, 2018 |
| | | // [ Date ]: Thursday, October 25, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | public partial class HorseConfig : ConfigBase {
|
| | |
|
| | | public partial class HorseConfig : ConfigBase { |
| | | |
| | | public int HorseID { get ; private set ; }
|
| | | public int ItemID { get ; private set ; }
|
| | | public string Name { get ; private set; }
|
| | |
| | | public int ShowFightPower { get ; private set ; }
|
| | | public int Sort { get ; private set ; }
|
| | | public int[] RideAudios;
|
| | | public string DescribeIconKey { get ; private set; } |
| | | |
| | | public override string getKey()
|
| | | {
|
| | | return HorseID.ToString();
|
| | | public override string getKey() |
| | | { |
| | | return HorseID.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try
|
| | | {
|
| | | try |
| | | { |
| | | HorseID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
|
| | |
|
| | | ItemID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
|
| | |
| | | { |
| | | int.TryParse(RideAudiosStringArray[i],out RideAudios[i]); |
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | |
| | | DescribeIconKey = rawContents[16].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11506fccebe60354881fb76fbc89c062 |
| | | timeCreated: 1533018682 |
| | | timeCreated: 1540439672 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, July 17, 2018 |
| | | // [ Date ]: Thursday, October 25, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | public partial class PetInfoConfig : ConfigBase {
|
| | |
|
| | | public partial class PetInfoConfig : ConfigBase { |
| | | |
| | | public int ID { get ; private set ; }
|
| | | public string Name { get ; private set; }
|
| | | public int Quality { get ; private set ; }
|
| | |
| | | public string InitFightPower { get ; private set; }
|
| | | public int ShowFightPower { get ; private set ; }
|
| | | public int Sort { get ; private set ; }
|
| | | public string DescribeIconKey { get ; private set; } |
| | | |
| | | public override string getKey()
|
| | | {
|
| | | return ID.ToString();
|
| | | public override string getKey() |
| | | { |
| | | return ID.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try
|
| | | {
|
| | | try |
| | | { |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
|
| | |
|
| | | Name = rawContents[1].Trim();
|
| | |
| | | ShowFightPower=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0;
|
| | |
|
| | | Sort=IsNumeric(rawContents[16]) ? int.Parse(rawContents[16]):0;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | |
| | | DescribeIconKey = rawContents[17].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7e4484056094f9b4da70da7a8bb05e3c |
| | | timeCreated: 1531808064 |
| | | licenseType: Free |
| | | timeCreated: 1540439638 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | // [ Date ]: Wednesday, October 24, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | public int EffectValue61 { get ; private set ; }
|
| | | public int EffectValue62 { get ; private set ; }
|
| | | public int EffectValue63 { get ; private set ; }
|
| | | public int StateSkillLV { get ; private set ; }
|
| | | public int LearnSkillReq { get ; private set ; }
|
| | | public int LearnSkillLV { get ; private set ; }
|
| | | public int LearnLVReq { get ; private set ; }
|
| | |
| | |
|
| | | EffectValue63=IsNumeric(rawContents[45]) ? int.Parse(rawContents[45]):0;
|
| | |
|
| | | LearnSkillReq=IsNumeric(rawContents[46]) ? int.Parse(rawContents[46]):0; |
| | | StateSkillLV=IsNumeric(rawContents[46]) ? int.Parse(rawContents[46]):0; |
| | |
|
| | | LearnSkillLV=IsNumeric(rawContents[47]) ? int.Parse(rawContents[47]):0; |
| | | LearnSkillReq=IsNumeric(rawContents[47]) ? int.Parse(rawContents[47]):0; |
| | |
|
| | | LearnLVReq=IsNumeric(rawContents[48]) ? int.Parse(rawContents[48]):0; |
| | | LearnSkillLV=IsNumeric(rawContents[48]) ? int.Parse(rawContents[48]):0; |
| | |
|
| | | LearnSkillPointReq=IsNumeric(rawContents[49]) ? int.Parse(rawContents[49]):0; |
| | | LearnLVReq=IsNumeric(rawContents[49]) ? int.Parse(rawContents[49]):0; |
| | |
|
| | | FightPower=IsNumeric(rawContents[50]) ? int.Parse(rawContents[50]):0; |
| | | LearnSkillPointReq=IsNumeric(rawContents[50]) ? int.Parse(rawContents[50]):0; |
| | |
|
| | | LVUpCostMoneyType=IsNumeric(rawContents[51]) ? int.Parse(rawContents[51]):0; |
| | | FightPower=IsNumeric(rawContents[51]) ? int.Parse(rawContents[51]):0; |
| | |
|
| | | LVUpCostMoney=IsNumeric(rawContents[52]) ? int.Parse(rawContents[52]):0; |
| | | LVUpCostMoneyType=IsNumeric(rawContents[52]) ? int.Parse(rawContents[52]):0; |
| | |
|
| | | LVUpCostExp=IsNumeric(rawContents[53]) ? int.Parse(rawContents[53]):0; |
| | | LVUpCostMoney=IsNumeric(rawContents[53]) ? int.Parse(rawContents[53]):0; |
| | |
|
| | | ClientActionLimit=IsNumeric(rawContents[54]) ? int.Parse(rawContents[54]):0; |
| | | LVUpCostExp=IsNumeric(rawContents[54]) ? int.Parse(rawContents[54]):0; |
| | |
|
| | | ClientSkillSeriesLimit=IsNumeric(rawContents[55]) ? int.Parse(rawContents[55]):0; |
| | | ClientActionLimit=IsNumeric(rawContents[55]) ? int.Parse(rawContents[55]):0; |
| | |
|
| | | SkillOfSeries=IsNumeric(rawContents[56]) ? int.Parse(rawContents[56]):0; |
| | | ClientSkillSeriesLimit=IsNumeric(rawContents[56]) ? int.Parse(rawContents[56]):0; |
| | |
|
| | | ExpendMPRate=IsNumeric(rawContents[57]) ? int.Parse(rawContents[57]):0; |
| | | SkillOfSeries=IsNumeric(rawContents[57]) ? int.Parse(rawContents[57]):0; |
| | |
|
| | | ExAttr1=IsNumeric(rawContents[58]) ? int.Parse(rawContents[58]):0; |
| | | ExpendMPRate=IsNumeric(rawContents[58]) ? int.Parse(rawContents[58]):0; |
| | |
|
| | | ExAttr3=IsNumeric(rawContents[59]) ? int.Parse(rawContents[59]):0; |
| | | ExAttr1=IsNumeric(rawContents[59]) ? int.Parse(rawContents[59]):0; |
| | |
|
| | | ExAttr4=IsNumeric(rawContents[60]) ? int.Parse(rawContents[60]):0; |
| | | ExAttr3=IsNumeric(rawContents[60]) ? int.Parse(rawContents[60]):0; |
| | |
|
| | | ExAttr5=IsNumeric(rawContents[61]) ? int.Parse(rawContents[61]):0; |
| | | ExAttr4=IsNumeric(rawContents[61]) ? int.Parse(rawContents[61]):0; |
| | |
|
| | | WarnInfo=IsNumeric(rawContents[62]) ? int.Parse(rawContents[62]):0; |
| | | ExAttr5=IsNumeric(rawContents[62]) ? int.Parse(rawContents[62]):0; |
| | |
|
| | | CtrlActionID=IsNumeric(rawContents[63]) ? int.Parse(rawContents[63]):0; |
| | | WarnInfo=IsNumeric(rawContents[63]) ? int.Parse(rawContents[63]):0; |
| | |
|
| | | BuffEffectID=IsNumeric(rawContents[64]) ? int.Parse(rawContents[64]):0; |
| | | CtrlActionID=IsNumeric(rawContents[64]) ? int.Parse(rawContents[64]):0; |
| | |
|
| | | EffectName=IsNumeric(rawContents[65]) ? int.Parse(rawContents[65]):0; |
| | | BuffEffectID=IsNumeric(rawContents[65]) ? int.Parse(rawContents[65]):0; |
| | |
|
| | | IconName = rawContents[66].Trim();
|
| | | EffectName=IsNumeric(rawContents[66]) ? int.Parse(rawContents[66]):0; |
| | |
|
| | | SkillNameIcon = rawContents[67].Trim();
|
| | | IconName = rawContents[67].Trim();
|
| | |
|
| | | Description = rawContents[68].Trim();
|
| | | SkillNameIcon = rawContents[68].Trim();
|
| | |
|
| | | BuffDescription = rawContents[69].Trim();
|
| | | Description = rawContents[69].Trim();
|
| | |
|
| | | Skillsource = rawContents[70].Trim();
|
| | | BuffDescription = rawContents[70].Trim();
|
| | |
|
| | | Skillactmark=IsNumeric(rawContents[71]) ? int.Parse(rawContents[71]):0; |
| | | Skillsource = rawContents[71].Trim();
|
| | |
|
| | | BuffDisplay=IsNumeric(rawContents[72]) ? int.Parse(rawContents[72]):0; |
| | | Skillactmark=IsNumeric(rawContents[72]) ? int.Parse(rawContents[72]):0; |
| | | |
| | | BuffDisplay=IsNumeric(rawContents[73]) ? int.Parse(rawContents[73]):0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: db393bd0ebb18b74e98ba16a7d19e7c6 |
| | | timeCreated: 1537946131 |
| | | timeCreated: 1540373341 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | switch (_assetPath)
|
| | | {
|
| | | case AssetPath.Resource:
|
| | | path = StringUtility.Contact("Config/", fileName);
|
| | | var textAsset = Resources.Load<TextAsset>(path);
|
| | | lines = textAsset.text.Split(new string[] { "\r\n" }, StringSplitOptions.None);
|
| | | path = AssetVersionUtility.GetBuiltInAssetFilePath(StringUtility.Contact("config/", fileName, ".txt"));
|
| | | if (File.Exists(path))
|
| | | {
|
| | | lines = File.ReadAllLines(path, Encoding.UTF8);
|
| | | }
|
| | | else
|
| | | {
|
| | | path = StringUtility.Contact("Config/", fileName);
|
| | | var textAsset = Resources.Load<TextAsset>(path);
|
| | | lines = textAsset.text.Split(new string[] { "\r\n" }, StringSplitOptions.None);
|
| | | }
|
| | | break;
|
| | | case AssetPath.ResourceOut:
|
| | | path = StringUtility.Contact(ResourcesPath.CONFIG_FODLER, "/", fileName, ".txt");
|
| | |
| | |
|
| | | void UpdateRequestRedpoint()
|
| | | {
|
| | | if (HasFairy && IsCanFunc(LimitFunc.CanKick))
|
| | | if (HasFairy && IsCanFunc(LimitFunc.CanCall))
|
| | | {
|
| | | applyRedpoint.state = applyList.Count > 0 ? RedPointState.Simple : RedPointState.None;
|
| | | }
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | namespace TableConfig |
| | | { |
| | | |
| | | public partial class ContactConfig : ConfigBase |
| | | { |
| | | |
| | | static List<ContactConfig> configs = null; |
| | | |
| | | public static ContactConfig GetConfig(string appid, int branch) |
| | | { |
| | | if (configs == null) |
| | | { |
| | | configs = Config.Instance.GetAllValues<ContactConfig>(); |
| | | } |
| | | |
| | | ContactConfig config = null; |
| | | foreach (var item in configs) |
| | | { |
| | | if (item.appid == appid) |
| | | { |
| | | if (config == null) |
| | | { |
| | | config = item; |
| | | } |
| | | else |
| | | { |
| | | if (item.branch == branch) |
| | | { |
| | | config = item; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 015500ded68878241bee5ee8d4d1d459 |
| | | timeCreated: 1540448380 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | |
| | | //04 11 玩家坐下/站立#tagPlayerSit |
| | | |
| | | |
| | | |
| | | public class DTC0411_tagPlayerSit : DtcBasic { |
| | | RealmModel m_RealmModel; |
| | | RealmModel realmModel { |
| | | get { |
| | | return m_RealmModel ?? (m_RealmModel = ModelCenter.Instance.GetModel<RealmModel>()); |
| | | } |
| | | } |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | |
| | | base.Done(vNetPack); |
| | | |
| | | H0411_tagPlayerSit vNetData = vNetPack as H0411_tagPlayerSit; |
| | | |
| | | if (vNetData != null) { |
| | | realmModel.OnRefreshData(vNetData); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | |
|
| | | //04 11 玩家坐下/站立#tagPlayerSit
|
| | |
|
| | |
|
| | |
|
| | | public class DTC0411_tagPlayerSit : DtcBasic
|
| | | {
|
| | | RealmModel m_RealmModel;
|
| | | RealmModel realmModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_RealmModel ?? (m_RealmModel = ModelCenter.Instance.GetModel<RealmModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | FairyFeastModel fairyFeastModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<FairyFeastModel>(); }
|
| | | }
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | H0411_tagPlayerSit vNetData = vNetPack as H0411_tagPlayerSit;
|
| | |
|
| | | if (vNetData != null)
|
| | | {
|
| | | realmModel.OnRefreshData(vNetData);
|
| | | fairyFeastModel.UpdateTransmitState(vNetData);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | |
|
| | |
|
| | |
|
| | | public class DTCAA1A_tagMCActWishingWellPlayerInfo : DtcBasic {
|
| | | public class DTCAA1A_tagMCActWishingWellPlayerInfo : DtcBasic
|
| | | {
|
| | |
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HAA1A_tagMCActWishingWellPlayerInfo vNetData = vNetPack as HAA1A_tagMCActWishingWellPlayerInfo;
wishModel.SetWishingWellPlayerInfo(vNetData);
|
| | | }
|
| | | }
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | HAA1A_tagMCActWishingWellPlayerInfo vNetData = vNetPack as HAA1A_tagMCActWishingWellPlayerInfo;
|
| | | wishModel.SetWishingWellPlayerInfo(vNetData);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | |
|
| | | // AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
|
| | |
|
| | |
|
| | |
|
| | | public class DTCAA1B_tagMCActWishingDragResult : DtcBasic {
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | HAA1B_tagMCActWishingDragResult vNetData = vNetPack as HAA1B_tagMCActWishingDragResult;
|
| | | wishModel.SetWishingResultInfo(vNetData);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e02a54b17dc643541b69454edefab46d |
| | | timeCreated: 1540300760 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | // AA 16 通知超值礼包信息 #tagMCSuperGiftInfo
|
| | |
|
| | | public class HAA16_tagMCSuperGiftInfo : GameNetPackBasic {
|
| | | public uint GiftID; //商品ID
|
| | | public string EndtDate; // 结束日期 y-m-d
|
| | | public uint StartTime;
|
| | |
|
| | | public HAA16_tagMCSuperGiftInfo () {
|
| | | _cmd = (ushort)0xAA16;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out GiftID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out StartTime, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | TransBytes (out WellItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | |
|
| | | TransBytes (out WellItemInfo[i].IsSpecial, vBytes, NetDataType.BYTE);
|
| | |
|
| | | }
|
| | |
|
| | | TransBytes (out CurAwardCnt, vBytes, NetDataType.BYTE);
|
| | |
| | | TransBytes (out CurAwardItemInfo[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | |
|
| | | TransBytes (out CurAwardItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | |
|
| | | TransBytes (out CurAwardItemInfo[i].IsSpecial, vBytes, NetDataType.BYTE);
|
| | |
|
| | | }
|
| | |
|
| | |
| | |
|
| | | TransBytes (out LastAwardItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | |
|
| | | TransBytes (out LastAwardItemInfo[i].IsSpecial, vBytes, NetDataType.BYTE);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public byte IsBind; // 是否绑定
|
| | |
|
| | | public byte IsSpecial; // 是否极品
|
| | |
|
| | | }
|
| | |
|
| | |
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
|
| | |
|
| | | public class HAA1B_tagMCActWishingDragResult : GameNetPackBasic {
|
| | | public byte Cnt;
|
| | | public tagMCPlayerWishingDragInfo[] InfoList;
|
| | |
|
| | | public HAA1B_tagMCActWishingDragResult () {
|
| | | _cmd = (ushort)0xAA1B;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | InfoList = new tagMCPlayerWishingDragInfo[Cnt];
|
| | | for (int i = 0; i < Cnt; i ++) {
|
| | | InfoList[i] = new tagMCPlayerWishingDragInfo();
|
| | | TransBytes (out InfoList[i].WellType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].Index, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out InfoList[i].ItemCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out InfoList[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out InfoList[i].IsSpecial, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCPlayerWishingDragInfo {
|
| | | public byte WellType; // 库 0-可选库 1-结果库
|
| | | public byte Index; // 索引
|
| | | public uint ItemID; // 物品ID
|
| | | public ushort ItemCnt; // 物品数量
|
| | | public byte IsBind; // 是否绑定
|
| | | public byte IsSpecial; // 是否极品
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4f77d8a999175554496515a4bc25d664 |
| | | timeCreated: 1540300760 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public bool initialized { get; private set; }
|
| | | public bool initializedUIAssetBundle { get; private set; }
|
| | |
|
| | | public void InitBuiltInAsset()
|
| | | {
|
| | | var path = AssetVersionUtility.GetBuiltInAssetFilePath("builtin_assetbundle");
|
| | | var assetBundle = AssetBundle.LoadFromFile(path);
|
| | | if (assetBundle == null)
|
| | | {
|
| | | DebugEx.LogError("AssetBundleManifest的包文件为空或者加载出错.");
|
| | | }
|
| | |
|
| | | var manifest = assetBundle.LoadAsset<AssetBundleManifest>(ResourcesPath.AssetDependentFileAssetName);
|
| | | if (manifest == null)
|
| | | {
|
| | | DebugEx.LogError("AssetBundleManifest文件为空或者加载出错.");
|
| | | }
|
| | |
|
| | | var bundles = manifest.GetAllAssetBundles();
|
| | | foreach (var bundle in bundles)
|
| | | {
|
| | | var dependenices = manifest.GetAllDependencies(bundle);
|
| | | var hash = manifest.GetAssetBundleHash(bundle);
|
| | | var assetBundleInfo = new AssetBundleInfo(bundle, hash, dependenices);
|
| | | m_AssetBundleInfoList.Add(assetBundleInfo);
|
| | | }
|
| | |
|
| | | assetBundle.Unload(true);
|
| | | assetBundle = null;
|
| | | }
|
| | |
|
| | | public void ReInitBuiltInAsset()
|
| | | {
|
| | | var path = AssetVersionUtility.GetBuiltInAssetFilePath("builtin_assetbundle");
|
| | | var assetBundle = AssetBundle.LoadFromFile(path);
|
| | | if (assetBundle == null)
|
| | | {
|
| | | DebugEx.LogError("AssetBundleManifest的包文件为空或者加载出错.");
|
| | | }
|
| | |
|
| | | var manifest = assetBundle.LoadAsset<AssetBundleManifest>(ResourcesPath.AssetDependentFileAssetName);
|
| | | if (manifest == null)
|
| | | {
|
| | | DebugEx.LogError("AssetBundleManifest文件为空或者加载出错.");
|
| | | }
|
| | |
|
| | | for (int i = m_AssetBundleInfoList.Count - 1; i >= 0; i--)
|
| | | {
|
| | | var item = m_AssetBundleInfoList[i];
|
| | | if (item.name.Contains("builtin"))
|
| | | {
|
| | | m_AssetBundleInfoList.Remove(item);
|
| | | }
|
| | | }
|
| | |
|
| | | var keys = new List<string>(m_AssetBundleDict.Keys);
|
| | | for (int i = keys.Count - 1; i >= 0; i--)
|
| | | {
|
| | | var item = keys[i];
|
| | | if (item.Contains("builtin"))
|
| | | {
|
| | | m_AssetBundleDict.Remove(item);
|
| | | }
|
| | | }
|
| | |
|
| | | var bundles = manifest.GetAllAssetBundles();
|
| | | foreach (var bundle in bundles)
|
| | | {
|
| | | var dependenices = manifest.GetAllDependencies(bundle);
|
| | | var hash = manifest.GetAssetBundleHash(bundle);
|
| | | var assetBundleInfo = new AssetBundleInfo(bundle, hash, dependenices);
|
| | | m_AssetBundleInfoList.Add(assetBundleInfo);
|
| | | }
|
| | |
|
| | | assetBundle.Unload(true);
|
| | | assetBundle = null;
|
| | | }
|
| | |
|
| | | public IEnumerator Initialize()
|
| | | {
|
| | | yield return StartCoroutine(Co_LoadMainfestFile("audio"));
|
| | |
| | | yield return Co_LoadAssetBundleDependenice(_assetBundleInfo);
|
| | | }
|
| | |
|
| | | var filePath = AssetVersionUtility.GetAssetFilePath(assetBundleName);
|
| | | var isBuiltin = assetBundleName.Contains("builtin");
|
| | | var filePath = isBuiltin ? AssetVersionUtility.GetBuiltInAssetFilePath(assetBundleName) : AssetVersionUtility.GetAssetFilePath(assetBundleName);
|
| | |
|
| | | DebugEx.LogFormat("Co_LoadAssetBundle(): 将要加载的assetBundle包路径 => {0}", filePath);
|
| | | var assetBundle = AssetBundle.LoadFromFile(filePath);
|
| | |
| | |
|
| | | Sync_LoadAssetBundleDependenice(_assetBundleInfo);
|
| | |
|
| | | string _path = AssetVersionUtility.GetAssetFilePath(assetBundleName);
|
| | | var isBuiltin = assetBundleName.Contains("builtin");
|
| | | string _path = isBuiltin ? AssetVersionUtility.GetBuiltInAssetFilePath(assetBundleName) : AssetVersionUtility.GetAssetFilePath(assetBundleName);
|
| | | AssetBundle _assetBundle = AssetBundle.LoadFromFile(_path);
|
| | |
|
| | | CacheAssetBundle(assetBundleName, _assetBundle);
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class BuiltInLoader |
| | | { |
| | | readonly static string PREFAB_EXTENSION = ".prefab"; |
| | | readonly static string SPRITE_EXTENSION = ".png"; |
| | | readonly static string AUDIO_EXTENSION = ".wav"; |
| | | |
| | | public static Sprite LoadSprite(string name) |
| | | { |
| | | Sprite sprite = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/UI/Sprites/", name, SPRITE_EXTENSION); |
| | | sprite = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(path); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var assetInfo = new AssetInfo("builtin/sprite", name); |
| | | sprite = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo, typeof(Sprite)) as Sprite; |
| | | } |
| | | |
| | | if (sprite == null) |
| | | { |
| | | DebugEx.LogErrorFormat("BuiltInLoader.LoadSprite() => 加载不到资源: {0}.", name); |
| | | } |
| | | |
| | | return sprite; |
| | | } |
| | | |
| | | public static GameObject LoadPrefab(string name) |
| | | { |
| | | GameObject prefab = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/UI/Prefabs/", name, PREFAB_EXTENSION); |
| | | prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var assetInfo = new AssetInfo("builtin/prefabs", name); |
| | | prefab = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject; |
| | | } |
| | | |
| | | if (prefab == null) |
| | | { |
| | | DebugEx.LogErrorFormat("BuiltInLoader.LoadPrefab() => 加载不到资源: {0}.", name); |
| | | } |
| | | |
| | | return prefab; |
| | | } |
| | | |
| | | public static void UnLoadPrefab(string name) |
| | | { |
| | | if (!AssetSource.builtInFromEditor) |
| | | { |
| | | AssetBundleUtility.Instance.UnloadAsset("builtin/prefabs", name); |
| | | } |
| | | } |
| | | |
| | | public static AudioClip LoadMusic(string name) |
| | | { |
| | | AudioClip audioClip = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Music/", name, AUDIO_EXTENSION); |
| | | audioClip = UnityEditor.AssetDatabase.LoadAssetAtPath<AudioClip>(path); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var assetInfo = new AssetInfo("builtin/music", name); |
| | | audioClip = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as AudioClip; |
| | | } |
| | | |
| | | if (audioClip == null) |
| | | { |
| | | DebugEx.LogErrorFormat("BuiltInLoader.LoadMusic() => 加载不到资源: {0}.", name); |
| | | } |
| | | |
| | | return audioClip; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 90d4474ca18a3f641af2abaf246763e2 |
| | | timeCreated: 1540434103 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Js = 4,// 极速
|
| | | }
|
| | |
|
| | | public E_ChannelPlatform ChannelPlatform { get; set; }
|
| | | public E_ChannelPlatform ChannelPlatform { get; set; }
|
| | |
|
| | | /// <summary>
|
| | | /// sdk初始化是否完成标识
|
| | |
| | | /// </summary>
|
| | | public UnityAction<NetworkReachability> OnNetworkStatusChanged;
|
| | |
|
| | | public static bool builtinAssetCopyFinished { get; private set; }
|
| | |
|
| | | /// <summary>
|
| | | /// 是否已经将StreamingAsset拷贝至目标路径
|
| | | /// </summary>
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | #if UNITY_ANDROID
|
| | | var builtinAssetsCopyFinishVersion = LocalSave.GetString("BuiltInAssetCopyCompleted_Android");
|
| | | if (string.IsNullOrEmpty(builtinAssetsCopyFinishVersion))
|
| | | {
|
| | | builtinAssetCopyFinished = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | builtinAssetCopyFinished = VersionConfig.Get().version == builtinAssetsCopyFinishVersion;
|
| | | }
|
| | | #endif
|
| | | #if UNITY_IOS
|
| | | var builtinAssetsCopyFinishVersion = LocalSave.GetString("BuiltInAssetCopyCompleted_IOS");
|
| | | if (string.IsNullOrEmpty(builtinAssetsCopyFinishVersion))
|
| | | {
|
| | | builtinAssetCopyFinished = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | builtinAssetCopyFinished = VersionConfig.Get().version == builtinAssetsCopyFinishVersion;
|
| | | }
|
| | |
|
| | | var assetsCopyFinishVersion = LocalSave.GetString("AssetCopyCompleted_IOS");
|
| | | if (string.IsNullOrEmpty(assetsCopyFinishVersion))
|
| | |
| | | }
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.AssetCopy;
|
| | | SendMessageToSDK(m_Json);
|
| | | }
|
| | |
|
| | | public void CopyOneAsset(string relationPath)
|
| | | {
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.CopyOneAsset;
|
| | | m_Json["fileName"] = relationPath;
|
| | | SendMessageToSDK(m_Json);
|
| | | }
|
| | |
|
| | |
| | | * 外部存储根目录地址
|
| | | */
|
| | | public const int ExteneralStorage = 11;
|
| | | public const int CopyOneAsset = 12;
|
| | | /**
|
| | | * 自由sdk相关
|
| | | * */
|
| | |
| | | if (m_StartedRotateCamera)
|
| | | {
|
| | | CameraController.Instance.Distance = 11;
|
| | | CameraController.Instance.rotationX = -11;
|
| | | CameraController.Instance.rotationX = -110;
|
| | | CameraController.Instance.rotationY = 50;
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | |
|
| | | return path;
|
| | | }
|
| | |
|
| | | public static string GetBuiltInAssetFilePath(string _assetKey)
|
| | | {
|
| | | var path = string.Empty;
|
| | | if (Application.platform == RuntimePlatform.Android)
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, _assetKey);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (SDKUtility.builtinAssetCopyFinished)
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, _assetKey);
|
| | | }
|
| | | else
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.StreamingAssetPath, _assetKey);
|
| | | }
|
| | | }
|
| | |
|
| | | return path;
|
| | | } |
| | | |
| | | public static bool IsUnpriorAssetDownLoadOk()
|
| | |
| | | public int totalCount { get; private set; }
|
| | | public int okCount { get; private set; }
|
| | | public bool restartApp { get; private set; }
|
| | | public bool reinitedBuiltInAsset { get; private set; }
|
| | |
|
| | | public event Action<Step> downLoadStepChangeEvent;
|
| | |
|
| | | Action downLoadOkCallBack;
|
| | |
|
| | | Step m_Step = Step.None;
|
| | | public Step step
|
| | | {
|
| | | public Step step {
|
| | | get { return m_Step; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (m_Step != value)
|
| | | {
|
| | | m_Step = value;
|
| | |
| | | okCount = 0;
|
| | | step = Step.DownLoadPrepared;
|
| | | restartApp = false;
|
| | | reinitedBuiltInAsset = false;
|
| | | totalSize = 0;
|
| | |
|
| | | for (int i = 0; i < tasks.Count; i++)
|
| | |
| | | restartApp = true;
|
| | | }
|
| | | #endif
|
| | |
|
| | | if (!reinitedBuiltInAsset && task.relativePath.Contains("builtin"))
|
| | | {
|
| | | reinitedBuiltInAsset = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if (totalSize > BYTE_PER_MILLIONBYTE)
|
| | |
| | | {
|
| | | SDKUtility.Instance.RestartApp();
|
| | | }
|
| | |
|
| | | if (reinitedBuiltInAsset)
|
| | | {
|
| | | AssetBundleUtility.Instance.ReInitBuiltInAsset();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFileDownLoadCompleted(bool _ok, AssetVersion _assetVersion)
|
| | |
| | | case 12:
|
| | | legendCntPreview.text = itemTipsModel.GetEquipLegendAttrCntPreview(itemAttrData);
|
| | | break;
|
| | | case 11:
|
| | | legendCntPreview.text = itemTipsModel.GetWingsLegendAttrCntPreview(itemAttrData);
|
| | | break;
|
| | | case 101:
|
| | | case 102:
|
| | | case 103:
|
| | |
| | |
|
| | | private void SetGemAttrUI()
|
| | | {
|
| | | if (itemAttrData.itemConfig.LV < itemTipsModel.gemOpenLvs[0])
|
| | | switch ((RoleEquipType)itemAttrData.itemConfig.EquipPlace)
|
| | | {
|
| | | gemAttr.SetActive(false);
|
| | | return;
|
| | | case RoleEquipType.retWeapon:
|
| | | case RoleEquipType.retWeapon2:
|
| | | case RoleEquipType.retHat:
|
| | | case RoleEquipType.retClothes:
|
| | | case RoleEquipType.retBelt:
|
| | | case RoleEquipType.retTrousers:
|
| | | case RoleEquipType.retShoes:
|
| | | case RoleEquipType.retNeck:
|
| | | case RoleEquipType.retFairyCan:
|
| | | case RoleEquipType.retFairyCan2:
|
| | | case RoleEquipType.retSpiritAnimal:
|
| | | if (itemAttrData.itemConfig.LV < itemTipsModel.gemOpenLvs[0])
|
| | | {
|
| | | gemAttr.SetActive(false);
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case RoleEquipType.retWing:
|
| | | gemAttr.SetActive(false);
|
| | | return;
|
| | | }
|
| | | gemAttr.SetActive(true);
|
| | | gemTitleText.text = Language.Get("EquipWin_GemPropObj_Text_1");
|
| | |
| | | {
|
| | | vipLimitText.SetActive(false);
|
| | | vipPray.SetActive(false);
|
| | | unVipPray.SetActive(true); |
| | | unVipPray.SetActive(true); |
| | | if (PrayModel.alreadyPrayNum >= PrayModel.everyDayNum)
|
| | | {
|
| | | prayBtnImg.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | alreadyPrayObj.SetActive(true);
|
| | | prayMoneyGo.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | prayMoneyGo.SetActive(true);
|
| | | prayBtn.AddListener(ClickPrayBtn);
|
| | | prayBtnImg.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | }
|
| | |
| | | vipPray.SetActive(true);
|
| | | unVipPray.SetActive(false);
|
| | | vipLimitText.SetActive(true);
|
| | | prayMoneyGo.SetActive(false);
|
| | | prayVipLimit.text = StringUtility.Contact("V",PrayModel.minVipLvLimit);
|
| | | prayBtn.AddListener(()=>
|
| | | {
|
| | |
| | | {
|
| | | WindowJumpMgr.Instance.ClearJumpData();
|
| | | WindowCenter.Instance.CloseImmediately<TreasureLevelUpWin>();
|
| | | WindowCenter.Instance.CloseImmediately<TreasureSelectWin>();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | try
|
| | | {
|
| | | if (chatCenter.IsChatBanned)
|
| | | if (chatCenter.IsChatBanned || IsInviteChat(content)
|
| | | || KillRegex.IsMatch(content))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | [CreateAssetMenu(menuName = "Config/VersionConfig")]
|
| | | public class VersionConfig : ScriptableObject
|
| | | {
|
| | | public const string VERSION_ALTERNATIVE = "0.0.0";
|
| | | public const string VERSION_ALTERNATIVE = "99.99.99";
|
| | |
|
| | | [SerializeField] public string m_AppId = string.Empty;
|
| | | public string appId { get { return m_AppId; } }
|
| | |
| | |
|
| | | public string GetApkRemoteUrl()
|
| | | {
|
| | | if (IsMaoErGame())
|
| | | if (versionInfo == null)
|
| | | {
|
| | | return string.Empty;
|
| | | }
|
| | |
|
| | | if (IsMaoErGame() && versionInfo.downAsset == 0)
|
| | | {
|
| | | if (maoerVersion.Keys.Contains("url"))
|
| | | {
|
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
| | | if (secondTypeDict != null)
|
| | | {
|
| | | if (secondTypeDict.Count >= 1 && curSecondType != 0
|
| | | && curThirdType == 1)
|
| | | && curThirdType >= 1)
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - 1);
|
| | | cellCtrl.JumpIndex(GetCurIndex(curSecondType));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetCurIndex(int secondType)
|
| | | {
|
| | | int curIndex = 0;
|
| | | List<int> secondlist = firstTypeDict.Keys.ToList();
|
| | | for (int i = 0; i < secondlist.Count; i++)
|
| | | {
|
| | | if (secondType == secondlist[i])
|
| | | {
|
| | | curIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | return curIndex;
|
| | | }
|
| | |
|
| | | private void RefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | Image icon = cell.transform.Find("BtnIcon").GetComponent<Image>();
|
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
| | | if (secondTypeDict.Count >= 1 && curSecondType != 0
|
| | | && curThirdType >= 1)
|
| | | {
|
| | | int remain = curSecondType - firstTypeDict.Count;
|
| | | if(remain > 0)
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType- remain);
|
| | | }
|
| | | else
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - 1);
|
| | | }
|
| | | cellCtrl.JumpIndex(GetCurIndex(curSecondType));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetCurIndex(int secondType)
|
| | | {
|
| | | int curIndex = 0;
|
| | | List<int> secondlist = firstTypeDict.Keys.ToList();
|
| | | for(int i = 0; i < secondlist.Count; i++)
|
| | | {
|
| | | if(secondType == secondlist[i])
|
| | | {
|
| | | curIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | return curIndex;
|
| | | }
|
| | |
|
| | | private void RefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | Image icon = cell.transform.Find("BtnIcon").GetComponent<Image>();
|
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
| | | {
|
| | | if (secondTypeDict.Count >= 1 && curSecondType != 0)
|
| | | {
|
| | | int remain = curSecondType - firstTypeDict.Count;
|
| | | if (remain > 0)
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - remain);
|
| | | }
|
| | | else
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - 1);
|
| | | }
|
| | | cellCtrl.JumpIndex(GetCurIndex(curSecondType));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetCurIndex(int secondType)
|
| | | {
|
| | | int curIndex = 0;
|
| | | List<int> secondlist = firstTypeDict.Keys.ToList();
|
| | | for (int i = 0; i < secondlist.Count; i++)
|
| | | {
|
| | | if (secondType == secondlist[i])
|
| | | {
|
| | | curIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | return curIndex;
|
| | | }
|
| | | private void RefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | Image icon = cell.transform.Find("BtnIcon").GetComponent<Image>();
|
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
| | | {
|
| | | if (secondTypeDict.Count >= 1 && curSecondType != 0)
|
| | | {
|
| | | int remain = curSecondType - firstTypeDict.Count;
|
| | | if (remain > 0)
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - remain);
|
| | | }
|
| | | else
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - 1);
|
| | | }
|
| | | cellCtrl.JumpIndex(GetCurIndex(curSecondType));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetCurIndex(int secondType)
|
| | | {
|
| | | int curIndex = 0;
|
| | | List<int> secondlist = firstTypeDict.Keys.ToList();
|
| | | for (int i = 0; i < secondlist.Count; i++)
|
| | | {
|
| | | if (secondType == secondlist[i])
|
| | | {
|
| | | curIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | return curIndex;
|
| | | }
|
| | |
|
| | | private IEnumerator SetOffestPos()
|
| | | {
|
| | | yield return null;
|
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
| | | {
|
| | | if (secondTypeDict.Count >= 1 && curSecondType != 0)
|
| | | {
|
| | | int remain = curSecondType - firstTypeDict.Count;
|
| | | if (remain > 0)
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - remain);
|
| | | }
|
| | | else
|
| | | {
|
| | | cellCtrl.JumpIndex(curSecondType - 1);
|
| | | }
|
| | | cellCtrl.JumpIndex(GetCurIndex(curSecondType));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetCurIndex(int secondType)
|
| | | {
|
| | | int curIndex = 0;
|
| | | List<int> secondlist = firstTypeDict.Keys.ToList();
|
| | | for (int i = 0; i < secondlist.Count; i++)
|
| | | {
|
| | | if (secondType == secondlist[i])
|
| | | {
|
| | | curIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | return curIndex;
|
| | | }
|
| | |
|
| | | private void RefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | Image icon = cell.transform.Find("BtnIcon").GetComponent<Image>();
|
| | |
| | | public const string POTENTIAL_NO_NOTIFY = "PotentialNoNotify";
|
| | | public const string FLASHSALE_REDPOINT = "FlashSale_Redpoint";
|
| | | public const string OSTIMEGIFT_REDPOINT = "OSTimeGift_Redpoint";
|
| | | public const string OSGIFT_REDPOINT = "OSGitf_Redpoint";
|
| | | public const string TASK_SKILL_HOLE = "TaskSkillHole";
|
| | | public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole";
|
| | | public const string LEAGUE_NOTICE_REDPOINT = "LeagueNoticeRedpoint";
|
| | |
| | | SetDayRemind(POTENTIAL_NO_NOTIFY);
|
| | | SetDayRemind(FLASHSALE_REDPOINT);
|
| | | SetDayRemind(OSTIMEGIFT_REDPOINT);
|
| | | SetDayRemind(OSGIFT_REDPOINT);
|
| | | SetDayRemind(TASK_SKILL_HOLE);
|
| | | SetDayRemind(RUNE_SPECIAL_HOLE);
|
| | | SetDayRemind(LEAGUE_NOTICE_REDPOINT);
|
| | |
| | | [SerializeField] Toggle m_Refdata; |
| | | [SerializeField] Toggle m_Shader; |
| | | [SerializeField] Toggle m_UI; |
| | | [SerializeField] Toggle m_BuiltIn; |
| | | |
| | | private void OnEnable() |
| | | { |
| | |
| | | m_Refdata.isOn = AssetSource.refdataFromEditor; |
| | | m_Shader.isOn = AssetSource.shaderFromEditor; |
| | | m_UI.isOn = AssetSource.uiFromEditor; |
| | | m_BuiltIn.isOn = AssetSource.builtInFromEditor; |
| | | |
| | | m_AllAsset.AddListener(OnAllAssetValueChange); |
| | | m_Audio.AddListener(OnAudioValueChange); |
| | |
| | | m_Refdata.AddListener(OnRefdataValueChange); |
| | | m_Shader.AddListener(OnShaderValueChange); |
| | | m_UI.AddListener(OnUIValueChange); |
| | | m_BuiltIn.AddListener(OnBuildInValueChange); |
| | | } |
| | | |
| | | private void OnDisable() |
| | |
| | | AssetSource.uiFromEditor = _value; |
| | | } |
| | | |
| | | private void OnBuildInValueChange(bool _value) |
| | | { |
| | | AssetSource.builtInFromEditor = _value; |
| | | } |
| | | |
| | | } |
| | |
| | | {
|
| | | if (debugRoot == null)
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UIRootDebug");
|
| | | var prefab = BuiltInLoader.LoadPrefab("UIRootDebug");
|
| | | debugRoot = GameObject.Instantiate(prefab);
|
| | | MonoBehaviour.DontDestroyOnLoad(debugRoot);
|
| | | debugRoot.name = "UIRootDebug";
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | playerPack.RefreshItemCountAct -= RefreshDogzEquipInfo;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateDogzState;
|
| | | curSumAssistNum = DogzAssistDefaultCnt;
|
| | | addAssistCnt = 0;
|
| | | SelectDogzItemQuality = 0;
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | SetDogzEquipInfo();
|
| | | playerPack.RefreshItemCountAct -= RefreshDogzEquipInfo;
|
| | | SetDogzEquipInfo(); |
| | | playerPack.RefreshItemCountAct += RefreshDogzEquipInfo;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateDogzState;
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | UpdateAssistNumRed();
|
| | |
| | | SysNotifyMgr.Instance.ShowTip("DogzQualityAsk", GetDogzPartNameByIndex(index), GetItemColorName(color));
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | private void UpdateDogzState(int funcId)
|
| | | {
|
| | | if (funcId != (int)FuncOpenEnum.Dogz) return;
|
| | |
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | UpdateAssistNumRed();
|
| | | }
|
| | |
|
| | |
|
| | | #region 协议
|
| | |
|
| | |
| | |
|
| | | public void UpdateDogzAssistRed()
|
| | | {
|
| | | foreach(var value in dogzAssistRedDict.Values)
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Dogz)) return;
|
| | |
|
| | | foreach (var value in dogzAssistRedDict.Values)
|
| | | {
|
| | | value.state = RedPointState.None;
|
| | | }
|
| | | |
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | |
| | |
|
| | | public void UpdateDogzEquipPlaceRed()
|
| | | {
|
| | | foreach(var value in dogzEquipPlaceRedDict.Values)
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Dogz)) return;
|
| | |
|
| | | foreach (var value in dogzEquipPlaceRedDict.Values)
|
| | | {
|
| | | foreach(var value2 in value.Values)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | foreach(var value in dogzAssistRedDict.Values)
|
| | | foreach (var value in dogzAssistRedDict.Values)
|
| | | {
|
| | | if(value.state == RedPointState.Simple)
|
| | | {
|
| | |
| | |
|
| | | public void UpdateAssistNumRed()
|
| | | {
|
| | | if(CheckIsAddAssistNum() && !IsAddMaxAssist())
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Dogz)) return;
|
| | |
|
| | | if (CheckIsAddAssistNum() && !IsAddMaxAssist())
|
| | | {
|
| | | if(addAssistDogzRedpoint.state == RedPointState.None)
|
| | | {
|
| | |
| | | public FairyFeastTop familyPartyTop;
|
| | | public int topPlayerID;
|
| | | public int enemyID;
|
| | | public int hasSit;
|
| | |
|
| | | public long totalExp
|
| | | {
|
| | |
| | | [SerializeField] FairyFeastRankBehaviour[] m_RankBehaviours;
|
| | | [SerializeField] FairyFeastRankBehaviour m_TopRank;
|
| | | [SerializeField] DungeonMultipleTaskWin.SelectEffect m_SelectEffect;
|
| | | [SerializeField] Button m_Transmit;
|
| | | [SerializeField] SmoothSlider m_TransmitSlider;
|
| | | [SerializeField] Text m_TransmitProgress;
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | FairyFeastModel fairyFeastModel { get { return ModelCenter.Instance.GetModel<FairyFeastModel>(); } }
|
| | |
|
| | | int currentSelect = 0;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_FairyFeast.onClick.AddListener(() =>
|
| | | {
|
| | |
| | | {
|
| | | Select(1);
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Transmit.onClick.AddListener(Transmit);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Select(0);
|
| | | m_TransmitSlider.ResetValue(0);
|
| | | model.updateMissionEvent += UpdateMissionEvent;
|
| | | fairyFeastModel.selectTransmit += SelectTransmit;
|
| | | fairyFeastModel.transmitStateUpdate += TransmitStateUpdate;
|
| | | SelectTransmit();
|
| | | }
|
| | |
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.updateMissionEvent -= UpdateMissionEvent;
|
| | | fairyFeastModel.selectTransmit -= SelectTransmit;
|
| | | fairyFeastModel.transmitStateUpdate -= TransmitStateUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | if (fairyFeastModel.transmiting)
|
| | | {
|
| | | if (!m_TransmitSlider.gameObject.activeSelf)
|
| | | {
|
| | | m_TransmitSlider.gameObject.SetActive(true);
|
| | | }
|
| | | var surplusTime = (fairyFeastModel.transmitCompleteTime - DateTime.Now).TotalSeconds;
|
| | | var progress = Mathf.Clamp01(1 - (float)surplusTime / fairyFeastModel.transmitCostSeconds);
|
| | | m_TransmitSlider.value = progress;
|
| | | m_TransmitProgress.text = StringUtility.Contact((int)(progress * 100), "%");
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_TransmitSlider.gameObject.activeSelf)
|
| | | {
|
| | | m_TransmitSlider.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | {
|
| | | return x.rank.CompareTo(y.rank);
|
| | | }
|
| | |
|
| | | private void SelectTransmit()
|
| | | {
|
| | | m_Transmit.gameObject.SetActive(fairyFeastModel.selectPlayer != 0 && fairyFeastModel.allowTransmit
|
| | | && !fairyFeastModel.transmiting);
|
| | | }
|
| | |
|
| | | private void Transmit()
|
| | | {
|
| | | fairyFeastModel.Transmit();
|
| | | }
|
| | |
|
| | | private void TransmitStateUpdate()
|
| | | {
|
| | | SelectTransmit();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | FairyModel model { get { return ModelCenter.Instance.GetModel<FairyModel>(); } }
|
| | |
|
| | | FairyFeastModel fairyFeastModel { get { return ModelCenter.Instance.GetModel<FairyFeastModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_GotoFeast.onClick.AddListener(OnGotoFeast);
|
| | |
| | | dungeonModel.updateMissionEvent += UpdateMissionEvent;
|
| | | GA_NpcCollect.OnArrive += OnArriveCollectNPC;
|
| | | GA_NpcCollect.OnLeave += OnLeaveCollectNpc;
|
| | | fairyFeastModel.selectTransmit += SelectTransmit;
|
| | | Display();
|
| | | }
|
| | |
|
| | |
| | | dungeonModel.updateMissionEvent -= UpdateMissionEvent;
|
| | | GA_NpcCollect.OnArrive -= OnArriveCollectNPC;
|
| | | GA_NpcCollect.OnLeave -= OnLeaveCollectNpc;
|
| | | fairyFeastModel.selectTransmit -= SelectTransmit;
|
| | | }
|
| | |
|
| | | private void SelectTransmit()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | |
| | | {
|
| | | var mapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | var collected = dungeonModel.mission.hasCollect;
|
| | | m_GotoFeast.gameObject.SetActive(mapId == 31230 && collected != 1 && !nearNpc);
|
| | | m_GotoFeast.gameObject.SetActive(mapId == 31230 && collected != 1 && !nearNpc && !fairyFeastModel.allowTransmit);
|
| | | }
|
| | |
|
| | | private void OnArriveCollectNPC(uint arg0, int _npcId)
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig;
|
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyFeastModel : Model, IBeforePlayerDataInitialize
|
| | | {
|
| | | public uint selectPlayer { get; private set; }
|
| | | public bool allowTransmit { get; private set; }
|
| | |
|
| | | public bool nearNpc { get; private set; }
|
| | |
|
| | | public event Action selectTransmit;
|
| | |
|
| | | public event Action transmitStateUpdate;
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | FairyModel fairyModel { get { return ModelCenter.Instance.GetModel<FairyModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | GA_Player.s_OnSelected += OnSelected;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | dungeonModel.updateMissionEvent += UpdateMissionEvent;
|
| | | PrepareHandler.Instance.OnPrepareEndSuccess += OnPrepareEndSuccess;
|
| | | GA_NpcCollect.OnArrive += OnArriveNpc;
|
| | | GA_NpcCollect.OnLeave += OnLeaveNpc;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | GA_Player.s_OnSelected -= OnSelected;
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | dungeonModel.updateMissionEvent -= UpdateMissionEvent;
|
| | | PrepareHandler.Instance.OnPrepareEndSuccess -= OnPrepareEndSuccess;
|
| | | GA_NpcCollect.OnArrive -= OnArriveNpc;
|
| | | GA_NpcCollect.OnLeave -= OnLeaveNpc;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | transmitCompleteTime = TimeUtility.ClientOriginalTime;
|
| | | if (transmitClock != null)
|
| | | {
|
| | | transmitClock.Stop();
|
| | | transmitClock = null;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | selectPlayer = 0;
|
| | | nearNpc = false;
|
| | | if (transmitClock != null)
|
| | | {
|
| | | transmitClock.Stop();
|
| | | transmitClock = null;
|
| | | }
|
| | | }
|
| | |
|
| | | private void SecondEvent()
|
| | | {
|
| | | if (selectPlayer != 0)
|
| | | {
|
| | | var actor = GAMgr.Instance.GetBySID(selectPlayer);
|
| | | bool update = false;
|
| | | if (actor == null || !(actor is GA_Player))
|
| | | {
|
| | | selectPlayer = 0;
|
| | | update = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | var player = actor as GA_Player;
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (SatisfyTransmitState())
|
| | | {
|
| | | var distance = MathUtility.CalDistance(player.Pos, hero.Pos);
|
| | | if (allowTransmit != (distance <= transmitDistance))
|
| | | {
|
| | | allowTransmit = distance <= transmitDistance;
|
| | | update = true;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (allowTransmit)
|
| | | {
|
| | | allowTransmit = false;
|
| | | update = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (update && selectTransmit != null)
|
| | | {
|
| | | selectTransmit();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnArriveNpc(uint arg0, int _npcId)
|
| | | {
|
| | | if (_npcId == fairyModel.fairyFeastDeskNpc)
|
| | | {
|
| | | nearNpc = true;
|
| | | SecondEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnLeaveNpc(uint arg0, int _npcId)
|
| | | {
|
| | | if (_npcId == fairyModel.fairyFeastDeskNpc)
|
| | | {
|
| | | nearNpc = false;
|
| | | SecondEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | float transmitDistance = 2f;
|
| | | public int transmitCostSeconds { get; private set; }
|
| | | void ParseConfig()
|
| | | {
|
| | | var config = Config.Instance.Get<FuncConfigConfig>("FairyFeastTransmit");
|
| | | transmitCostSeconds = 15;
|
| | | if (config != null)
|
| | | {
|
| | | transmitDistance = float.Parse(config.Numerical1);
|
| | | transmitCostSeconds = int.Parse(config.Numerical2);
|
| | | }
|
| | | }
|
| | |
|
| | | bool SatisfyTransmitState()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero == null || hero.IsCollecting()
|
| | | || hero.IsCollect() || hero.IsDaZuo() || nearNpc)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | private void OnSelected(uint serverInstId, bool select)
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId != 31230)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (transmiting)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var mission = dungeonModel.mission;
|
| | | if (mission.hasSit == 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | selectPlayer = 0;
|
| | | allowTransmit = false;
|
| | | if (select)
|
| | | {
|
| | | var actor = GAMgr.Instance.GetBySID(serverInstId);
|
| | | if (actor != null && actor is GA_Player)
|
| | | {
|
| | | var player = actor as GA_Player;
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | var distance = MathUtility.CalDistance(player.Pos, hero.Pos);
|
| | | if (SatisfyTransmitState())
|
| | | {
|
| | | allowTransmit = distance <= transmitDistance;
|
| | | }
|
| | | selectPlayer = serverInstId;
|
| | | }
|
| | | }
|
| | | if (selectTransmit != null)
|
| | | {
|
| | | selectTransmit();
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 仙盟宴会采集结束
|
| | | /// </summary>
|
| | | private void OnPrepareEndSuccess()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId != 31230)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var mission = dungeonModel.mission;
|
| | | if (mission.hasSit == 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>()
|
| | | || WindowCenter.Instance.ExitAnyFullScreenOrMaskWin())
|
| | | {
|
| | | return;
|
| | | }
|
| | | var list = GAMgr.Instance.GetTypeList(E_ActorClassType.Player);
|
| | | if (list != null)
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | var player = list[i] as GA_Player;
|
| | | if (player != null)
|
| | | {
|
| | | var distance = MathUtility.CalDistance(player.Pos, hero.Pos);
|
| | | if (distance < transmitDistance)
|
| | | {
|
| | | player.OnClick();
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateMissionEvent()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId != 31230)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var mission = dungeonModel.mission;
|
| | | if (mission.hasSit == 1 && selectPlayer != 0)
|
| | | {
|
| | | selectPlayer = 0;
|
| | | if (selectTransmit != null)
|
| | | {
|
| | | selectTransmit();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #region 服务端数据
|
| | | public DateTime transmitCompleteTime { get; private set; }
|
| | | public bool transmiting
|
| | | {
|
| | | get
|
| | | {
|
| | | return DateTime.Now < transmitCompleteTime;
|
| | | }
|
| | | }
|
| | |
|
| | | private Clock transmitClock = null;
|
| | |
|
| | | public void Transmit()
|
| | | {
|
| | | if (selectPlayer != 0)
|
| | | {
|
| | | CA508_tagCMDoFBAction pak = new CA508_tagCMDoFBAction();
|
| | | pak.ActionType = 0;
|
| | | pak.ActionInfo = selectPlayer;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateTransmitState(H0411_tagPlayerSit package)
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId != 31230 || package.PlayerID != PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (package.Type == 0)
|
| | | {
|
| | | transmitCompleteTime = DateTime.Now.AddTicks(transmitCostSeconds * TimeSpan.TicksPerSecond);
|
| | | transmitClock = Clock.Create(transmitCostSeconds, TransmitComplete);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (transmitClock != null)
|
| | | {
|
| | | transmitClock.Stop();
|
| | | transmitClock = null;
|
| | | }
|
| | | transmitCompleteTime = TimeUtility.ClientOriginalTime;
|
| | | }
|
| | | if (transmitStateUpdate != null)
|
| | | {
|
| | | transmitStateUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | | void TransmitComplete()
|
| | | {
|
| | | transmitClock = null;
|
| | | CA508_tagCMDoFBAction pak = new CA508_tagCMDoFBAction();
|
| | | pak.ActionType = 1;
|
| | | pak.ActionInfo = 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | if (transmitStateUpdate != null)
|
| | | {
|
| | | transmitStateUpdate();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5903c3e70810d3e49936a4f4729c79ed |
| | | timeCreated: 1539661724 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public int noticeShowPet { get; private set; }
|
| | | public int noticeShowHorse { get; private set; }
|
| | |
|
| | | public int cacheGotoBossId { get; private set; }
|
| | |
|
| | | private bool serverInited = false;
|
| | | //private DateTime lastQueryProgressTime = DateTime.Now;
|
| | |
|
| | |
| | | public event Action<int> bossProgressUpdate;
|
| | | public event Action bossAllProgressUpdate;
|
| | | public event Action bossGrabHintEvent;
|
| | | public event Action gotoBossStateUpdate;
|
| | |
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | PlayerDeadModel deadModel { get { return ModelCenter.Instance.GetModel<PlayerDeadModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent += MinuteEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | deadModel.AllPlayerDieEvent += PlayerDieEvent;
|
| | | deadModel.AllPlayerRebornEvent += AllPlayerRebornEvent;
|
| | | OpenServerActivityCenter.Instance.Register(13, this);
|
| | | }
|
| | |
|
| | |
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent -= MinuteEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | deadModel.AllPlayerDieEvent -= PlayerDieEvent;
|
| | | deadModel.AllPlayerRebornEvent -= AllPlayerRebornEvent;
|
| | | }
|
| | |
|
| | | private void AllPlayerRebornEvent(H0419_tagPlayerReborn package)
|
| | | {
|
| | | if (package.PlayerID == PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | if (cacheGotoBossId != 0)
|
| | | {
|
| | | if (package.Type != 0)
|
| | | {
|
| | | cacheGotoBossId = 0;
|
| | | }
|
| | | if (gotoBossStateUpdate != null)
|
| | | {
|
| | | gotoBossStateUpdate();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDieEvent(uint playerId)
|
| | | {
|
| | | if (PlayerDatas.Instance.PlayerId != playerId)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.fairyData.HasFairy && FuncOpen.Instance.IsFuncOpen(139))
|
| | | {
|
| | | RecheckGrabBoss();
|
| | | if (WindowCenter.Instance.IsOpen<FairyGrabBossHintWin>())
|
| | | {
|
| | | var list = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
|
| | | if (list != null)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | GA_NpcFightBoss bossActor = list[i] as GA_NpcFightBoss;
|
| | | if (bossActor != null && bosses.Contains(bossActor.NpcConfig.NPCID))
|
| | | {
|
| | | cacheGotoBossId = bossActor.NpcConfig.NPCID;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | |
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | cacheGotoBossId = 0;
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | grabBossHintOpen = false;
|
| | |
| | | return;
|
| | | }
|
| | | grabBossHintOpen = true;
|
| | | cacheGotoBossId = 0;
|
| | | if (!WindowCenter.Instance.IsOpen<FairyGrabBossHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyGrabBossHintWin>();
|
| | |
| | | if (bossGrabHintEvent != null)
|
| | | {
|
| | | bossGrabHintEvent();
|
| | | }
|
| | | if (gotoBossStateUpdate != null)
|
| | | {
|
| | | gotoBossStateUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (fairyGrabBossHelpUpdate != null)
|
| | | {
|
| | | fairyGrabBossHelpUpdate();
|
| | | }
|
| | | }
|
| | | if (cacheGotoBossId != 0)
|
| | | {
|
| | | cacheGotoBossId = 0;
|
| | | if (gotoBossStateUpdate != null)
|
| | | {
|
| | | gotoBossStateUpdate();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsBossKilled(int bossId)
|
| | | {
|
| | | BossProgressInfo bossProgress;
|
| | | bool killed = false;
|
| | | if (TryGetBossProgress(bossId, out bossProgress))
|
| | | {
|
| | | var progress = 1 - (float)bossProgress.currentHp / bossProgress.totalHp;
|
| | | killed = progress >= 1;
|
| | | }
|
| | | return killed;
|
| | | }
|
| | |
|
| | | public bool TestEnterDungeon(int bossId, out int _error)
|
| | | {
|
| | | if (!InActivityTime)
|
| | |
| | | var error = 0;
|
| | | if (model.TestEnterDungeon(model.selectBoss, out error))
|
| | | {
|
| | | if (IsBossKilled(model.selectBoss))
|
| | | if (model.IsBossKilled(model.selectBoss))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FairyGrabBossOver");
|
| | | }
|
| | |
| | | {
|
| | | model.DisplayErrorTip(error);
|
| | | }
|
| | | }
|
| | |
|
| | | bool IsBossKilled(int bossId)
|
| | | {
|
| | | FairyGrabBossModel.BossProgressInfo bossProgress;
|
| | | bool killed = false;
|
| | | if (model.TryGetBossProgress(bossId, out bossProgress))
|
| | | {
|
| | | var progress = 1 - (float)bossProgress.currentHp / bossProgress.totalHp;
|
| | | killed = progress >= 1;
|
| | | }
|
| | | return killed;
|
| | | }
|
| | |
|
| | | private void KillRecord()
|
| | |
| | | } |
| | | private void OnOpenChangeBtn() |
| | | { |
| | | if (!PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanCall)) |
| | | if (!PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanNotify)) |
| | | { |
| | | MessageWin.Inst.ShowFixedTip(Language.Get("L1019")); |
| | | return; |
| | |
| | | |
| | | private void RefreshChangeTipBtn() |
| | | { |
| | | var _changeTip = PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanCall); |
| | | var _changeTip = PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanNotify); |
| | | openChangeBtn.gameObject.SetActive(_changeTip); |
| | | } |
| | | |
| | |
| | | PlayerDatas.Instance.fairyData.OnRefreshApplyList += OnRefreshApplyList; |
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine += OnRefreshFairyMine; |
| | | OnRefreshApplyList(); |
| | | |
| | | if (applyList.Count > 0)
|
| | | {
|
| | | CA402_tagCGViewFamilyRequestInfo pak = new CA402_tagCGViewFamilyRequestInfo();
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | private void OnRefreshFairyMine()
|
| | | {
|
| | | if (!PlayerDatas.Instance.fairyData.HasFairy
|
| | | || !PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanKick))
|
| | | || !PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanCall))
|
| | | {
|
| | | CloseImmediately();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public List<int> GetElderGodBosses()
|
| | | public List<int> GetElderGodNpces()
|
| | | {
|
| | | var bosses = new List<int>();
|
| | | bosses.Add(sortedElites[0]);
|
| | |
| | | return bosses;
|
| | | }
|
| | |
|
| | | public List<int> GetElderGodBosses()
|
| | | {
|
| | | var bosses = new List<int>();
|
| | | bosses.AddRange(sortedBossIds);
|
| | | return bosses;
|
| | | }
|
| | |
|
| | | public int GetRecommendNpc()
|
| | | {
|
| | | foreach (var item in sortedBossIds) |
| | |
| | | private void ShowBosses()
|
| | | {
|
| | | var bosses = new List<int>();
|
| | | bosses.AddRange(model.GetElderGodBosses());
|
| | | bosses.AddRange(model.GetElderGodNpces());
|
| | |
|
| | | model.selectedBoss = model.GetRecommendNpc();
|
| | | DisplayNpcBaseInfo(true);
|
| | |
| | | {
|
| | | XBModel.GetNotifyResult(xbResultItemBasiclist[index].itemConfig.ID, int.Parse(xbResultItemBasiclist[index].countText.text));
|
| | | }
|
| | | XBModel.GetNotifyResult(xbResultItemBasiclist[index].itemConfig.ID, int.Parse(xbResultItemBasiclist[index].countText.text));
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } } |
| | | ItemOverdueModel model { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } } |
| | | |
| | | private void OnEnable() |
| | | { |
| | | m_Close.AddListener(CloseItemShow); |
| | |
| | | WindowCenter.Instance.Open<VipOverdueWin>(); |
| | | break; |
| | | case ItemType.SpiritAnimal: |
| | | model.guardOverdueIndex = model.currentShowItem.index; |
| | | WindowCenter.Instance.Open<GuardOverdueWin>(); |
| | | break; |
| | | } |
| | |
| | |
|
| | | ItemConfig itemConfig;
|
| | | TimeSpan guardTime;
|
| | | public static string guid;
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | | guid = string.Empty;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | private void InitUI()
|
| | | {
|
| | | itemOverduelist = null;
|
| | | itemModel = playerPack.GetItemModelByIndex(PackType.rptItem,itemOverdue.guardOverdueIndex);
|
| | | guid = string.IsNullOrEmpty(guid) || guid == "" ? itemOverdue.currentShowItem.guid : guid;
|
| | | itemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if (itemModel == null) return;
|
| | |
|
| | | itemBG.SetItemBackGround(modelInterface.GetItemQuality(itemModel.itemInfo.ItemID,itemModel.useDataDict));
|
| | |
| | |
|
| | | if (isOk)
|
| | | {
|
| | | itemOverdue.SendRenewalQuest(itemOverdue.guardOverdueIndex,2);
|
| | | itemOverdue.SendRenewalQuest(itemModel.itemInfo.ItemPlace,2);
|
| | | CloseWin();
|
| | | }
|
| | | });
|
| | |
| | |
|
| | | if(isOk)
|
| | | {
|
| | | itemOverdue.SendRenewalQuest(itemOverdue.guardOverdueIndex, 1);
|
| | | itemOverdue.SendRenewalQuest(itemModel.itemInfo.ItemPlace, 1);
|
| | | CloseWin();
|
| | | }
|
| | | });
|
| | |
| | | {
|
| | | get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
| | | }
|
| | |
|
| | | public int guardOverdueIndex { get; set; }
|
| | |
|
| | | public Dictionary<int, string> guardOverdueIconDict { get; private set;}
|
| | |
|
| | | Dictionary<string,OverdueItem> itemStack = new Dictionary<string,OverdueItem>();
|
| | |
| | | {
|
| | | isdelay = true;
|
| | | GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
|
| | | guardOverdueIndex = -1;
|
| | | playerPack.RefreshItemCountAct -= UpdateItemCount;
|
| | | itemStack.Clear();
|
| | | itemGuids.Clear();
|
| | | currentShowItem = default(OverdueItem);
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | playerPack.RefreshItemCountAct += UpdateItemCount;
|
| | | GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
|
| | | time = 0;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateItemCount(PackType type, int index, int id)
|
| | | {
|
| | | if (type != PackType.rptItem && type != PackType.rptWarehouse) return;
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(id);
|
| | | if (itemConfig == null || itemConfig.EquipPlace != (int)RoleEquipType.retSpiritAnimal) return;
|
| | |
|
| | | bool isRemove = false;
|
| | | for(int i = 0; i < itemGuids.Count; i++)
|
| | | {
|
| | | string guid = itemGuids[i];
|
| | | ItemModel itemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if(itemModel == null || itemModel.packType != PackType.rptItem)
|
| | | {
|
| | | isRemove = true;
|
| | | if (itemGuids.Contains(guid))
|
| | | {
|
| | | itemGuids.Remove(guid);
|
| | | }
|
| | |
|
| | | if (itemStack.ContainsKey(guid))
|
| | | {
|
| | | itemStack.Remove(guid);
|
| | | }
|
| | | }
|
| | | }
|
| | | if(isRemove)
|
| | | {
|
| | | RefreshCurrrentShowUseItem();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnGetOverdueItem(int itemId, string guid,int index)
|
| | | {
|
| | | var overdueItem = new OverdueItem(itemId,guid,index);
|
| | |
| | | if (list.Count > 1)
|
| | | {
|
| | | SetAllGuardIdlist();
|
| | | guardOverdueIndex = int.Parse(list[1].ToString());
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem, guardOverdueIndex);
|
| | | int index = int.Parse(list[1].ToString());
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem, index);
|
| | | if (itemModel != null)
|
| | | {
|
| | | List<int> renewallist = GetRenewallist(itemModel.itemId);
|
| | |
| | | if (models != null && models.Count > 0)
|
| | | {
|
| | | ItemModel overdueModel = models[0];
|
| | | guardOverdueIndex = overdueModel.itemInfo.ItemPlace;
|
| | | OnGetOverdueItem(overdueModel.itemInfo.ItemID, overdueModel.itemInfo.ItemGUID, overdueModel.itemInfo.ItemPlace);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | guardOverdueIndex = -1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | for (int i = idlist.Count - 1; i > -1; i--)
|
| | | {
|
| | | models = allGuardDict[type][idlist[i]];
|
| | | if(models != null && models.Count > 0)
|
| | | if(models != null)
|
| | | {
|
| | | ItemModel itemModel = models[0];
|
| | | if (!overdueGuardPushlist.Contains(itemModel))
|
| | | bool isHave = false;
|
| | | for(int j = 0; j < models.Count; j++)
|
| | | {
|
| | | overdueGuardPushlist.Add(itemModel);
|
| | | ItemModel itemModel = models[j];
|
| | | if(itemModel.packType == PackType.rptItem)
|
| | | {
|
| | | isHave = true;
|
| | | if (!overdueGuardPushlist.Contains(itemModel))
|
| | | {
|
| | | overdueGuardPushlist.Add(itemModel);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | break;
|
| | | if(isHave)
|
| | | {
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public Dictionary<int, HorseConfig> unlockMountDict { get; private set; }
|
| | | private Dictionary<int, Dictionary<int, int>> petSkillDict = new Dictionary<int, Dictionary<int, int>>(); // 编号 解锁阶级 技能
|
| | | private Dictionary<int, Dictionary<int, List<int>>> mountSkillDict = new Dictionary<int, Dictionary<int, List<int>>>(); // 编号 解锁阶级 技能
|
| | |
|
| | | public Dictionary<int, string> petAndMountQualityDict = new Dictionary<int, string>();
|
| | | public string expValueFormula = "";
|
| | |
|
| | | public int[] guardAutoDrops;
|
| | |
| | |
|
| | | FuncConfigConfig randomRuneConfig = Config.Instance.Get<FuncConfigConfig>("RandomRuneIDList");
|
| | | randomRuneIds = ConfigParse.GetMultipleStr<int>(randomRuneConfig.Numerical1);
|
| | |
|
| | | FuncConfigConfig petQuality = Config.Instance.Get<FuncConfigConfig>("PetQuality");
|
| | | int[] qualitys = ConfigParse.GetMultipleStr<int>(petQuality.Numerical1);
|
| | | string[] qualityNames = ConfigParse.GetMultipleStr(petQuality.Numerical2);
|
| | | if (qualitys != null && qualityNames != null
|
| | | && qualitys.Length == qualityNames.Length)
|
| | | {
|
| | | for(int i = 0; i < qualitys.Length; i++)
|
| | | {
|
| | | petAndMountQualityDict.Add(qualitys[i],qualityNames[i]);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | {
|
| | | if(isOverdue)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.renewal, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendRenewalQuest(ItemWinBtnType.renewal, attrData.index); });
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.renewal, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendRenewalQuest(ItemWinBtnType.renewal, attrData.guid); });
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public string GetQualityName(int quality)
|
| | | {
|
| | | string nameStr = string.Empty;
|
| | | petAndMountQualityDict.TryGetValue(quality,out nameStr);
|
| | | return nameStr;
|
| | | }
|
| | |
|
| | | public Dictionary<int,List<int>> GetMountSkillDict(int unlockId)
|
| | | {
|
| | | if(unlockMountDict.ContainsKey(unlockId))
|
| | |
| | | return modellist;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取装备评分最高可提升战力的装备
|
| | | /// </summary>
|
| | | /// <param name="_places"></param>
|
| | | /// <returns></returns>
|
| | | public string GetHighestScoreEquipByPlace(int equipPlace)
|
| | | {
|
| | | var itemPackage = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | var allItems = itemPackage.GetPackModelIndexDict();
|
| | | ItemModel putModel = playerPack.GetItemModelByIndex(PackType.rptEquip,equipPlace);
|
| | | equipPlace = (equipPlace == 9 || equipPlace == 10) ? 9 : equipPlace;
|
| | | var guid = string.Empty;
|
| | | var equips = new List<string>();
|
| | | var score = putModel == null ? 0 : putModel.equipScore;
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | foreach (var item in allItems.Values)
|
| | | {
|
| | | if(item.chinItemModel.EquipPlace == equipPlace)
|
| | | {
|
| | | if (!IsOverdue(item.itemInfo.ItemGUID, item.itemId)
|
| | | && (item.chinItemModel.JobLimit == 0 || (item.chinItemModel.JobLimit / 100) == job) && item.equipScore > score)
|
| | | {
|
| | | guid = item.itemInfo.ItemGUID;
|
| | | score = item.equipScore;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return guid;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 背包整理后好的同类型最好的装备
|
| | |
| | | if (!IsCanPutOn(itemModel)) return;
|
| | |
|
| | | int equipPlace = itemModel.chinItemModel.EquipPlace;
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptEquip);
|
| | | ItemModel putOnModel = null;
|
| | | if (singlePack != null)
|
| | | {
|
| | | putOnModel = singlePack.GetItemModelByIndex(equipPlace);
|
| | | }
|
| | | if (!itemModelDict.ContainsKey(equipPlace))
|
| | | {
|
| | | Dictionary<int, ItemModel> dict = new Dictionary<int, ItemModel>();
|
| | | if (putOnModel == null)
|
| | | if (IsFightUp(itemModel.itemId,itemModel.equipScore) == 1)
|
| | | {
|
| | | dict.Add(itemModel.itemInfo.ItemPlace, itemModel);
|
| | | itemModelDict.Add(equipPlace, dict);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemModel.equipScore > putOnModel.equipScore)
|
| | | {
|
| | | dict.Add(itemModel.itemInfo.ItemPlace, itemModel);
|
| | | itemModelDict.Add(equipPlace, dict);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if(putOnModel == null)
|
| | | if (IsFightUp(itemModel.itemId, itemModel.equipScore) == 1)
|
| | | {
|
| | | if (!itemModelDict[equipPlace].ContainsKey(itemModel.itemInfo.ItemPlace))
|
| | | {
|
| | | itemModelDict[equipPlace].Add(itemModel.itemInfo.ItemPlace, itemModel);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemModel.equipScore > putOnModel.equipScore)
|
| | | {
|
| | | itemModelDict[equipPlace].Add(itemModel.itemInfo.ItemPlace, itemModel);
|
| | | }
|
| | | itemModelDict[equipPlace].Add(itemModel.itemInfo.ItemPlace, itemModel);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | return CheckPutOnLimit(itemModel.itemId);
|
| | | return CheckPutOnRealm(itemModel.chinItemModel);
|
| | | }
|
| | |
|
| | | private bool CheckPutOnLimit(int itemId)
|
| | | private bool CheckPutOnRealm(ItemConfig config)
|
| | | {
|
| | | int playerLv = PlayerDatas.Instance.baseData.LV;
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
|
| | | if (itemConfig == null) return false;
|
| | |
|
| | | if (itemConfig.EquipPlace != (int)RoleEquipType.retWing)
|
| | | var _realmLv = config.RealmLimit;
|
| | | if (PlayerDatas.Instance.baseData.realmLevel < _realmLv)
|
| | | {
|
| | | if (itemConfig.UseLV > playerLv) return false;
|
| | | float sumOffsetPoint = 0;
|
| | | float offset = 0;
|
| | | if (itemConfig.LimitSTR != 0)
|
| | | {
|
| | | offset = itemConfig.LimitSTR - UIHelper.GetPropertyMapPlayerData(AttrEnum.POWER);
|
| | | sumOffsetPoint += offset;
|
| | | }
|
| | |
|
| | | if (itemConfig.LimitPHY != 0)
|
| | | {
|
| | | offset = itemConfig.LimitPHY - UIHelper.GetPropertyMapPlayerData(AttrEnum.AGILITY);
|
| | | sumOffsetPoint += offset;
|
| | | }
|
| | |
|
| | | if (itemConfig.LimitPNE != 0)
|
| | | {
|
| | | offset = itemConfig.LimitPNE - UIHelper.GetPropertyMapPlayerData(AttrEnum.MENTALITY);
|
| | | sumOffsetPoint += offset;
|
| | | }
|
| | |
|
| | | if (sumOffsetPoint <= PlayerDatas.Instance.baseData.FreePoint)
|
| | | {
|
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AddPoint))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | else
|
| | | {
|
| | | var _realmLv = 1;
|
| | | GeneralDefine.wingEquipLimits.TryGetValue(itemId, out _realmLv);
|
| | | var needRealmConfig = Config.Instance.Get<RealmConfig>(_realmLv);
|
| | | var curRealmConfig = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.realmLevel < _realmLv)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | ItemConfig chinItemModel = Config.Instance.Get<ItemConfig>(_itemID);
|
| | | if (chinItemModel != null)
|
| | | {
|
| | | if (chinItemModel.Type < 101 || chinItemModel.Type >= 110) return 0;
|
| | | if (chinItemModel.EquipPlace < 1 || chinItemModel.EquipPlace > 12) return 0;
|
| | | ItemModel model = playerPack.GetItemModelByIndex(PackType.rptEquip,chinItemModel.EquipPlace);
|
| | | if (chinItemModel.EquipPlace == (int)RoleEquipType.retFairyCan)
|
| | | {
|
| | |
| | | get { return _suitModel ?? (_suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>()); }
|
| | | }
|
| | |
|
| | | RolePointModel rolePointModel { get { return ModelCenter.Instance.GetModel<RolePointModel>(); } }
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | |
|
| | |
|
| | |
| | | foreach (var key in sumOffsetlist.Keys)
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshFreePoint;
|
| | | //rolePointModel.SendAddPoint((int)key, (int)sumOffsetlist[key]);
|
| | | rolePointModel.SendAddPoint((int)key, (int)sumOffsetlist[key]);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (useItemModel.itemInfo.ItemID == fairyModel.changeFairyNameItem)
|
| | | if(itemModel.itemId == 952)
|
| | | {
|
| | | int maxUseCnt = GetOfflineMaxNum(itemModel);
|
| | | if(maxUseCnt <= 1)
|
| | | {
|
| | | if (!CheckIsMaxOfflineTime(maxUseCnt,itemModel))
|
| | | {
|
| | | SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | BatchUseModel.Instance.SetOfflineUseModel(itemModel.itemInfo.ItemGUID);
|
| | | WindowCenter.Instance.Open<OfflineHangUpUseWin>();
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | if (itemModel.itemInfo.ItemID == fairyModel.changeFairyNameItem)
|
| | | {
|
| | | if (PlayerDatas.Instance.fairyData.HasFairy)
|
| | | {
|
| | |
| | | {
|
| | | switch (itemModel.itemInfo.ItemID)
|
| | | {
|
| | | case 952:
|
| | | if (!CheckIsMaxOfflineTime(itemModel))
|
| | | {
|
| | | SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
| | | }
|
| | | break;
|
| | | case RoleRenameWin.renameToolId:
|
| | | WindowCenter.Instance.Open<RoleRenameWin>();
|
| | | break;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private bool CheckIsMaxOfflineTime(ItemModel itemModel)
|
| | | public int GetOfflineMaxNum(ItemModel itemModel)
|
| | | {
|
| | | int willTime = HangUpSetModel.Instance.offlinePluginTime + itemModel.chinItemModel.EffectValueA1;
|
| | | if (HangUpSetModel.Instance.offlinePluginTime >= HangUpSetModel.Instance.maxOfflinePluginTime)
|
| | | int remainOffline = HangUpSetModel.Instance.maxOfflinePluginTime - HangUpSetModel.Instance.offlinePluginTime;
|
| | | int maxUseCnt = 0;
|
| | | if (remainOffline > 0)
|
| | | {
|
| | | int extraCnt = remainOffline % itemModel.chinItemModel.EffectValueA1 > 0 ? 1 : 0;
|
| | | maxUseCnt = remainOffline / itemModel.chinItemModel.EffectValueA1 + extraCnt;
|
| | | if (maxUseCnt > itemModel.itemInfo.ItemCount)
|
| | | {
|
| | | return itemModel.itemInfo.ItemCount;
|
| | | }
|
| | | }
|
| | | return maxUseCnt;
|
| | | }
|
| | |
|
| | | public bool CheckIsMaxOfflineTime(int useNum, ItemModel itemModel)
|
| | | {
|
| | | int remainOffline = HangUpSetModel.Instance.maxOfflinePluginTime - HangUpSetModel.Instance.offlinePluginTime;
|
| | | if (remainOffline <= 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OfflinePluginTime");
|
| | | return true;
|
| | | }
|
| | | else if (willTime > HangUpSetModel.Instance.maxOfflinePluginTime)
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("OfflinePluginTime102"), Language.Get("OfflinePluginTime101"), (bool isOk) =>
|
| | | int willTime = HangUpSetModel.Instance.offlinePluginTime + itemModel.chinItemModel.EffectValueA1 * useNum;
|
| | | if (willTime > HangUpSetModel.Instance.maxOfflinePluginTime)
|
| | | {
|
| | | if (isOk)
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("OfflinePluginTime102"), Language.Get("OfflinePluginTime101"), (bool isOk) =>
|
| | | {
|
| | | SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
| | | }
|
| | | });
|
| | | return true;
|
| | | if (isOk)
|
| | | {
|
| | | SendMakeUseQuest(itemModel.itemInfo.ItemPlace,useNum);
|
| | | }
|
| | | });
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void SendMakeUseQuest(int index, int useCnt = 1, int extra = 0)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem,index);
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送续费请求
|
| | | public void SendRenewalQuest(ItemWinBtnType btnType,int index)
|
| | | public void SendRenewalQuest(ItemWinBtnType btnType,string guid)
|
| | | {
|
| | | itemOverdue.guardOverdueIndex = index;
|
| | | GuardOverdueWin.guid = guid;
|
| | | WindowCenter.Instance.Open<GuardOverdueWin>();
|
| | | }
|
| | | #endregion
|
| | |
| | | public Dictionary<int, int[]> DungeonToDrugDict { get; private set; } //key 副本ID,value丹药ID列表
|
| | | public List<AttrFruitConfig> makeDruglist { get; private set; }
|
| | | public Dictionary<int, Dictionary<int, int>> decomposeAttrDict = new Dictionary<int, Dictionary<int, int>>();
|
| | | public static string StrengthAttrShift_RecordKey = "StrengthAttrShift";
|
| | | public static string StrengthAttrShift_RecordKey = "";
|
| | | public const string RecordKnapsackTitle = "RecordKnapsackTitle";
|
| | | public string RoleEquipLocalSave = "";
|
| | | public int MaxBagGridCnt { get; private set; }
|
| | | public int InitBagGridCnt { get; private set; }
|
| | | public int MaxDepotGridCnt { get; private set; }
|
| | | public int InitDepotGridCnt { get; private set; }
|
| | | BlastFurnaceModel FurnaceModel { get { return ModelCenter.Instance.GetModel<BlastFurnaceModel>(); } }
|
| | |
|
| | | public List<int> LocalSavePlaceArray { get; private set;}
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | List<DungeonOpenTimeConfig> dungeonlist = Config.Instance.GetAllValues<DungeonOpenTimeConfig>();
|
| | | if (dungeonlist != null)
|
| | | {
|
| | |
| | | InitBagGridCnt = int.Parse(Config.Instance.Get<FuncConfigConfig>("InitBagCellCount").Numerical1);
|
| | | MaxBagGridCnt = int.Parse(Config.Instance.Get<FuncConfigConfig>("MaxBagCellCount").Numerical1);
|
| | | MaxDepotGridCnt = int.Parse(Config.Instance.Get<FuncConfigConfig>("MaxDepotCellCount").Numerical1);
|
| | | SetRoleEquipRedpoint();
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= UpdatePlayerLv;
|
| | | LocalSave.DeleteKey(RecordKnapsackTitle);
|
| | | cacheMapId = 0;
|
| | | playerPackDict.Clear();
|
| | |
| | | PackSendQuestMgr.Instance.SendOpenWarehouse();
|
| | | SetPlayerAttrActiveRedPoint();
|
| | | EquipDecomRedCtrl();
|
| | | StrengthAttrShift_RecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID,StrengthAttrShift_RecordKey);
|
| | | RoleEquipLocalSave = StringUtility.Contact("RoleEquipLocalSave", PlayerDatas.Instance.baseData.PlayerID);
|
| | | StrengthAttrShift_RecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "StrengthAttrShift");
|
| | | if(LocalSave.GetIntArray(RoleEquipLocalSave) != null)
|
| | | {
|
| | | LocalSavePlaceArray = LocalSave.GetIntArray(RoleEquipLocalSave).ToList();
|
| | | }
|
| | | else
|
| | | {
|
| | | LocalSavePlaceArray = null;
|
| | | }
|
| | | |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += UpdatePlayerLv;
|
| | | UpdatePlayerLv(PlayerDataRefresh.LV);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region 玩家装备特殊逻辑
|
| | | public int fairyRedPointLvlimt { get; private set; }
|
| | | public int wingsRedpointLvlimt { get; private set; }
|
| | | public int fairyGetPathId { get; private set; }
|
| | | public Dictionary<int, int> wingsGetPathIdDict { get; private set;}
|
| | | public void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("WingYuPeiHQTJ");
|
| | | fairyRedPointLvlimt = int.Parse(funcConfig.Numerical1);
|
| | | wingsRedpointLvlimt = int.Parse(funcConfig.Numerical2);
|
| | | fairyGetPathId = int.Parse(funcConfig.Numerical3);
|
| | | wingsGetPathIdDict = ConfigParse.GetDic<int, int>(funcConfig.Numerical4);
|
| | | }
|
| | |
|
| | | public int GetRoleEquipPathId(int equipPlace)
|
| | | { |
| | | int playerJob = PlayerDatas.Instance.baseData.Job;
|
| | | switch ((RoleEquipType)equipPlace)
|
| | | {
|
| | | case RoleEquipType.retFairyCan:
|
| | | case RoleEquipType.retFairyCan2:
|
| | | return fairyGetPathId;
|
| | | case RoleEquipType.retWing:
|
| | | if(wingsGetPathIdDict.ContainsKey(playerJob))
|
| | | {
|
| | | return wingsGetPathIdDict[playerJob];
|
| | | }
|
| | | break;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void UpdatePlayerLv(PlayerDataRefresh type)
|
| | | {
|
| | | if (type != PlayerDataRefresh.LV) return;
|
| | | for(int i = 1; i < 13; i++)
|
| | | {
|
| | | CheckRoleEquipByPlace((RoleEquipType)i);
|
| | | }
|
| | | UpdateRoleEquipRed();
|
| | | }
|
| | |
|
| | | public bool IsShowAddEquipByPlace(int equipPlace)
|
| | | {
|
| | | switch ((RoleEquipType)equipPlace)
|
| | | {
|
| | | case RoleEquipType.retFairyCan:
|
| | | case RoleEquipType.retFairyCan2:
|
| | | if(PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | break;
|
| | | case RoleEquipType.retWing:
|
| | | if (PlayerDatas.Instance.baseData.LV >= wingsRedpointLvlimt)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | break;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void CheckRoleEquipByPlace(RoleEquipType equipType)
|
| | | {
|
| | | ItemModel itemModel = GetItemModelByIndex(PackType.rptEquip,(int)equipType);
|
| | | switch (equipType)
|
| | | {
|
| | | case RoleEquipType.retFairyCan:
|
| | | case RoleEquipType.retFairyCan2:
|
| | | if (PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt && itemModel != null)
|
| | | {
|
| | | SetRoleEquipLocalSave((int)equipType);
|
| | | }
|
| | | break;
|
| | | case RoleEquipType.retWing:
|
| | | if (PlayerDatas.Instance.baseData.LV >= wingsRedpointLvlimt && itemModel != null)
|
| | | {
|
| | | SetRoleEquipLocalSave((int)equipType);
|
| | | }
|
| | | break;
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | public void SetRoleEquipLocalSave(int equipPlace,bool isRedState = false)
|
| | | {
|
| | | if (isRedState && roleEquipRedDict[equipPlace].state == RedPointState.None) return;
|
| | |
|
| | | if(LocalSavePlaceArray != null)
|
| | | {
|
| | | if(!LocalSavePlaceArray.Contains(equipPlace))
|
| | | {
|
| | | LocalSavePlaceArray.Add(equipPlace);
|
| | | LocalSave.SetIntArray(RoleEquipLocalSave, LocalSavePlaceArray.ToArray());
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | LocalSavePlaceArray = new List<int>();
|
| | | LocalSavePlaceArray.Add(equipPlace);
|
| | | LocalSave.SetIntArray(RoleEquipLocalSave, LocalSavePlaceArray.ToArray());
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void GetItemEventCtrl(ItemModel itemModel)
|
| | | {
|
| | | if (showDropItem)
|
| | |
| | | }
|
| | |
|
| | | #region 红点逻辑判断
|
| | | private Dictionary<int, Redpoint> roleEquipRedDict = new Dictionary<int, Redpoint>();
|
| | | public void SetRoleEquipRedpoint()
|
| | | {
|
| | | roleEquipRedDict.Clear();
|
| | | for (int i = 1; i < 13; i++)
|
| | | {
|
| | | int redKey = 102011003 + i;
|
| | | Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_BagFuncKey, redKey);
|
| | | roleEquipRedDict.Add(i,redpoint);
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateRoleEquipRed()
|
| | | {
|
| | | foreach(var key in roleEquipRedDict.Keys)
|
| | | {
|
| | | ItemModel itemModel = GetItemModelByIndex(PackType.rptEquip,key);
|
| | | switch ((RoleEquipType)key)
|
| | | {
|
| | | case RoleEquipType.retFairyCan:
|
| | | if (PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt && !TryGetRoleEquipLocalSave(key)
|
| | | && itemModel == null && roleEquipRedDict[(int)RoleEquipType.retFairyCan2].state == RedPointState.None)
|
| | | {
|
| | | roleEquipRedDict[key].state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | roleEquipRedDict[key].state = RedPointState.None;
|
| | | }
|
| | | break;
|
| | | case RoleEquipType.retFairyCan2:
|
| | | if (PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt && !TryGetRoleEquipLocalSave(key)
|
| | | && itemModel == null && roleEquipRedDict[(int)RoleEquipType.retFairyCan].state == RedPointState.None)
|
| | | {
|
| | | roleEquipRedDict[key].state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | roleEquipRedDict[key].state = RedPointState.None;
|
| | | }
|
| | | break;
|
| | | case RoleEquipType.retWing:
|
| | | if (PlayerDatas.Instance.baseData.LV >= wingsRedpointLvlimt && !TryGetRoleEquipLocalSave(key)
|
| | | && itemModel == null)
|
| | | {
|
| | | roleEquipRedDict[key].state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | roleEquipRedDict[key].state = RedPointState.None;
|
| | | }
|
| | | break;
|
| | | default:
|
| | | roleEquipRedDict[key].state = RedPointState.None;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private bool TryGetRoleEquipLocalSave(int equipPlace)
|
| | | {
|
| | | if(LocalSavePlaceArray != null)
|
| | | {
|
| | | for(int i = 0; i < LocalSavePlaceArray.Count; i++)
|
| | | {
|
| | | if(equipPlace == 9 || equipPlace == 10)
|
| | | {
|
| | | if (LocalSavePlaceArray[i] == 9 || LocalSavePlaceArray[i] == 10)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (LocalSavePlaceArray[i] == equipPlace)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public const int ITEMPACK_REDKEY = 102011003;
|
| | | public Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_BagFuncKey, ITEMPACK_REDKEY);
|
| | | private void RedPointPackCtrl(PackType type)
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public event Action RefreshBagEvent;
|
| | | public void RefreshBagInfo()
|
| | | {
|
| | | if(RefreshBagEvent != null)
|
| | | {
|
| | | RefreshBagEvent();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void SetJumpToOneKeySell(Transform parent)
|
| | |
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | |
|
| | | private void RefreshWashAttrDes()
|
| | | {
|
| | | //float initPoint = rolePointModel.GetPointCreate(PlayerDatas.Instance.baseData.Job)[(int)selectAttr];
|
| | | //switch (selectAttr)
|
| | | //{
|
| | | // case AttrEnum.POWER:
|
| | | // washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BaseSTR) - initPoint;
|
| | | // break;
|
| | | // case AttrEnum.AGILITY:
|
| | | // washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BasePHY) - initPoint;
|
| | | // break;
|
| | | // case AttrEnum.PHYSIQUE:
|
| | | // washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BaseCON) - initPoint;
|
| | | // break;
|
| | | // case AttrEnum.MENTALITY:
|
| | | // washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BasePNE) - initPoint;
|
| | | // break;
|
| | | //}
|
| | | var model = ModelCenter.Instance.GetModel<RolePointModel>();
|
| | | Dictionary<int, int> dict = null;
|
| | | bool isContain = model.TryGetPointInit(PlayerDatas.Instance.baseData.Job,out dict);
|
| | | float initPoint = 0;
|
| | | if(isContain && dict.ContainsKey((int)selectAttr))
|
| | | {
|
| | | initPoint = dict[(int)selectAttr];
|
| | | }
|
| | | switch (selectAttr)
|
| | | {
|
| | | case AttrEnum.POWER:
|
| | | washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BaseSTR) - initPoint;
|
| | | break;
|
| | | case AttrEnum.AGILITY:
|
| | | washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BasePHY) - initPoint;
|
| | | break;
|
| | | case AttrEnum.PHYSIQUE:
|
| | | washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BaseCON) - initPoint;
|
| | | break;
|
| | | case AttrEnum.MENTALITY:
|
| | | washPoint = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataRefresh.BasePNE) - initPoint;
|
| | | break;
|
| | | }
|
| | |
|
| | | PlayerPropertyConfig propertyConfig = Config.Instance.Get<PlayerPropertyConfig>((int)selectAttr);
|
| | | washAttrDesText.text = Language.Get("BagWin_Washpoint2", propertyConfig.Name, UIHelper.GetPropertyMapPlayerData(selectAttr), washPoint);
|
| | |
| | | protected override void OnPreOpen() {
|
| | |
|
| | | KnapsackTimeCDMgr.Instance.RefreshItemOverdueAct += RefreshRemainTime;
|
| | | playerPack.RefreshBagEvent += RefreshBagInfo;
|
| | | playerPack.lookEquipEvent += LookEquip;
|
| | | playerPack.RefreshItemCountAct += OnAddItemCell;
|
| | | playerPack.RefreshPackAct += RefreshPackModel;
|
| | | playerPack.GridRefreshEvent += OnPackCanUseGrid;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen() {
|
| | |
|
| | | this.transform.SetAsLastSibling();
|
| | |
| | | playerPack.RefreshPackAct -= RefreshPackModel;
|
| | | playerPack.lookEquipEvent -= LookEquip;
|
| | | playerPack.GridRefreshEvent -= OnPackCanUseGrid;
|
| | | playerPack.RefreshBagEvent -= RefreshBagInfo;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose() {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void RefreshBagInfo()
|
| | | {
|
| | | _gridlineCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | public void OnRefrenshUIModel() {
|
| | | packModel = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | OnCreateGridLineCell(_gridlineCtrl);
|
| | |
| | | storeConfig = null;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 离线挂机服使用数据
|
| | | public string offlineGuid { get; private set; }
|
| | | public void SetOfflineUseModel(string guid)
|
| | | {
|
| | | this.offlineGuid = guid;
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | ItemConfig config = Config.Instance.Get<ItemConfig>(itemId);
|
| | | int playerJob = PlayerDatas.Instance.baseData.Job;
|
| | | if (config == null || (!isCompare && compareSocre <= 0) || config.EquipPlace == 0 |
| | | || score == compareSocre || type == PackType.rptEquip || type == PackType.rptDogzEquip) return 0;
|
| | | if (config == null || (!isCompare && compareSocre == 0) || config.EquipPlace == 0 |
| | | || (score == compareSocre && compareSocre != 0) || (compareSocre <= 0 && (type == PackType.rptEquip || type == PackType.rptDogzEquip))) return 0;
|
| | |
|
| | | ItemModel model = playerPack.GetItemModelByGUID(guid);
|
| | | if (model != null && modelInterface.IsOverdue(guid, itemId, model.useDataDict)) return 1;
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class EquipPlaceCell : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Button noneItemBtn;
|
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] public RoleEquipType equipType;
|
| | |
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
| | | }
|
| | | PackModelInterface _modelInterface;
|
| | | PackModelInterface modelInterface
|
| | | {
|
| | | get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
| | | }
|
| | |
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | GetItemPathModel pathModel { get { return ModelCenter.Instance.GetModel<GetItemPathModel>(); } }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | Display((int)this.equipType);
|
| | | }
|
| | |
|
| | | public void Display(int equipPlace)
|
| | | {
|
| | | if (this.equipType != (RoleEquipType)equipPlace) return;
|
| | |
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip,equipPlace);
|
| | | noneItemBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.onClick.RemoveAllListeners();
|
| | |
|
| | | if (itemModel == null)
|
| | | {
|
| | | itemCell.gameObject.SetActive(false);
|
| | | if(playerPack.IsShowAddEquipByPlace(equipPlace))
|
| | | {
|
| | | noneItemBtn.gameObject.SetActive(true);
|
| | | noneItemBtn.AddListener(()=>
|
| | | {
|
| | | playerPack.SetRoleEquipLocalSave(equipPlace,true);
|
| | | playerPack.UpdateRoleEquipRed();
|
| | | string guid = modelInterface.GetHighestScoreEquipByPlace(equipPlace);
|
| | | if (string.IsNullOrEmpty(guid))
|
| | | {
|
| | | int pathId = playerPack.GetRoleEquipPathId(equipPlace);
|
| | | if(pathId != 0)
|
| | | {
|
| | | pathModel.SetChinItemModel(pathId);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | playerPack.SetLookIndex(guid);
|
| | | playerPack.RefreshBagInfo();
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | noneItemBtn.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | playerPack.CheckRoleEquipByPlace((RoleEquipType)equipPlace);
|
| | | playerPack.UpdateRoleEquipRed();
|
| | | noneItemBtn.gameObject.SetActive(false);
|
| | | itemCell.gameObject.SetActive(true);
|
| | | itemCell.Init(itemModel);
|
| | | itemCell.cellBtn.onClick.AddListener(() => {
|
| | | itemTipsModel.SetItemTipsModel(PackType.rptEquip, itemModel.itemInfo.ItemGUID, false);
|
| | | itemTipsModel.SetPutOnTipsBtn(itemTipsModel.curAttrData);
|
| | | itemTipsModel.ShowUICtrl();
|
| | |
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fab44501321b6294caf4e7cabb066e2d |
| | | timeCreated: 1540263979 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using DG.Tweening;
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class GetWingsPathTips : MonoBehaviour
|
| | | {
|
| | | #region TopUI
|
| | | [SerializeField]
|
| | | Button closeBtn;
|
| | | [SerializeField]
|
| | | GameObject putOnIcon;
|
| | | [SerializeField]
|
| | | Text titleText;
|
| | | [SerializeField]
|
| | | Text equipScoreDes;
|
| | | [SerializeField]
|
| | | Text equipScoreValue;
|
| | | [SerializeField]
|
| | | Text conditionText;
|
| | | [SerializeField]
|
| | | Image conditionValueText;
|
| | | [SerializeField]
|
| | | Text dateText;
|
| | | [SerializeField]
|
| | | ItemCell itemCell;
|
| | | #endregion
|
| | |
|
| | | #region MidUI
|
| | | [SerializeField]
|
| | | RectTransform attrContent;
|
| | | [SerializeField]
|
| | | ScrollRect scrollRect;
|
| | | [SerializeField]
|
| | | LayoutElement scrollLayout;
|
| | |
|
| | | [SerializeField]
|
| | | GameObject basicAttr;
|
| | | [SerializeField]
|
| | | Text basicTitleText;
|
| | | [SerializeField]
|
| | | Text basicAttrDes;
|
| | | [SerializeField]
|
| | | GameObject legendAttr;
|
| | | [SerializeField]
|
| | | Text legendTitleText;
|
| | | [SerializeField]
|
| | | Text legendCntPreview;
|
| | | [SerializeField]
|
| | | Text legendAttrDes;
|
| | |
|
| | | [SerializeField] List<GameObject> attrCutLinelist = new List<GameObject>();
|
| | | #endregion
|
| | | [SerializeField]
|
| | | protected RectTransform _itemInfoTips;
|
| | |
|
| | | [SerializeField] RectTransform getWaysTips;
|
| | |
|
| | | [SerializeField]
|
| | | protected CanvasGroup _getWaysTipsAlpha;
|
| | |
|
| | | [SerializeField]
|
| | | private ScrollerController _waysCtrl;
|
| | |
|
| | | [SerializeField]
|
| | | private Transform waysLineCell;
|
| | |
|
| | | [SerializeField]
|
| | | private Button _closeWaysBtn;
|
| | |
|
| | | [SerializeField]
|
| | | [Header("移动时间")]
|
| | | protected float _moveTime = 0.3f;
|
| | |
|
| | | [SerializeField]
|
| | | protected CanvasGroup tipAlpha;
|
| | |
|
| | | [SerializeField] GameObject equipTipsObj;
|
| | | #region BottomUI
|
| | | [SerializeField]
|
| | | GameObject bottomPart;
|
| | | [SerializeField]
|
| | | private Button _getItemBtn;
|
| | | #endregion
|
| | |
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | PackModelInterface _modelInterface;
|
| | | PackModelInterface modelInterface
|
| | | {
|
| | | get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
| | | }
|
| | |
|
| | | ItemAttrData itemAttrData;
|
| | | private int curAttrTypeNum = 0;
|
| | |
|
| | | public void InitModel(ItemAttrData attrData)
|
| | | {
|
| | | curAttrTypeNum = 0;
|
| | | KnapsackTimeCDMgr.Instance.RefreshItemOverdueTimeAct += RefreshRemainTime;
|
| | | itemAttrData = attrData;
|
| | | InitUI();
|
| | | closeBtn.AddListener(OnClickCloseBtn);
|
| | | _waysCtrl.OnRefreshCell += RefreshWayCell;
|
| | | _getItemBtn.onClick.AddListener(OnClickGetItemBtn);
|
| | | _closeWaysBtn.onClick.AddListener(OnClickCloseBtn);
|
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | StartCoroutine(SetScrollSize());
|
| | | }
|
| | |
|
| | | IEnumerator SetScrollSize()
|
| | | {
|
| | | yield return null;
|
| | | yield return null;
|
| | | attrContent.anchoredPosition3D = new Vector3(attrContent.anchoredPosition3D.x, 0, 0);
|
| | | SetMidUIHeight(attrContent.rect.height);
|
| | | StartCoroutine(ShowBottomPart());
|
| | | }
|
| | |
|
| | | IEnumerator ShowBottomPart()
|
| | | {
|
| | | yield return null;
|
| | | bottomPart.gameObject.SetActive(true);
|
| | | StartCoroutine(SetPanelScale());
|
| | | }
|
| | |
|
| | | IEnumerator SetPanelScale()
|
| | | {
|
| | | yield return null;
|
| | | itemTipsModel.SetCurTips(this.GetComponent<RectTransform>());
|
| | | SetGetWaysPos();
|
| | | //_itemInfoTips.localPosition = Vector3.zero;
|
| | | tipAlpha.alpha = 1;
|
| | | }
|
| | | public void SetGetWaysPos()
|
| | | {
|
| | | if (itemTipsModel.compareAttrData != null)
|
| | | {
|
| | | getWaysTips.anchoredPosition3D = Vector3.zero;
|
| | | }
|
| | | else
|
| | | {
|
| | | getWaysTips.anchoredPosition3D = new Vector3(this.GetComponent<RectTransform>().sizeDelta.x / 2, 0, 0);
|
| | | }
|
| | | }
|
| | | private void InitUI()
|
| | | {
|
| | | #region 设置TopUI
|
| | | titleText.text = itemTipsModel.GetItemTipsTitle(itemAttrData);
|
| | | titleText.color = UIHelper.GetUIColor(modelInterface.GetItemQuality(itemAttrData.itemId, itemAttrData.useDataDict));
|
| | | ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId, itemAttrData.isPreview, (ulong)itemAttrData.count, itemAttrData.isBind,
|
| | | itemAttrData.guid, itemAttrData.packType, itemAttrData.isCompare, itemAttrData.useDataDict);
|
| | | itemCell.Init(cellModel);
|
| | | if (itemAttrData.packType == PackType.rptEquip)
|
| | | {
|
| | | putOnIcon.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | putOnIcon.SetActive(false);
|
| | | }
|
| | |
|
| | | equipScoreDes.text = Language.Get("EquipWin_EquipPointText_1");
|
| | | equipScoreValue.text = itemAttrData.score.ToString();
|
| | | if (itemAttrData.isHavePutLimit)
|
| | | {
|
| | | conditionText.gameObject.SetActive(true);
|
| | | conditionValueText.gameObject.SetActive(true);
|
| | | var _realmLv = itemAttrData.itemConfig.RealmLimit;
|
| | | var _realmCfg = Config.Instance.Get<RealmConfig>(_realmLv);
|
| | | if (PlayerDatas.Instance.baseData.realmLevel < _realmLv)
|
| | | {
|
| | | conditionText.text = UIHelper.GetTextColorByItemColor(TextColType.Red, Language.Get("RealmLimit1"));
|
| | | if (_realmLv != 0)
|
| | | {
|
| | | conditionValueText.SetSprite(_realmCfg.Img);
|
| | | }
|
| | | else
|
| | | {
|
| | | conditionText.gameObject.SetActive(false);
|
| | | conditionValueText.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_realmLv != 0)
|
| | | {
|
| | | conditionText.text = StringUtility.Contact("<color=#FFF4CDFF>", Language.Get("RealmLimit1"), "</color>");
|
| | | conditionValueText.SetSprite(_realmCfg.Img);
|
| | | }
|
| | | else
|
| | | {
|
| | | conditionText.gameObject.SetActive(false);
|
| | | conditionValueText.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | conditionText.gameObject.SetActive(false);
|
| | | conditionValueText.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | |
|
| | | if (itemAttrData.itemConfig.ExpireTime > 0)
|
| | | {
|
| | | List<int> itemEffectTime = itemAttrData.GetUseDataModel((int)ItemUseDataKey.Def_IudetCreateTime);
|
| | | if (itemEffectTime != null && itemEffectTime[0] != 0 && itemAttrData.guid != "")
|
| | | {
|
| | | RefreshRemainTime(itemAttrData.guid);
|
| | | }
|
| | | else
|
| | | {
|
| | | SetDateLimitUI(itemAttrData.itemConfig.ExpireTime);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | dateText.gameObject.SetActive(false);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 设置MidUI
|
| | | SetBasicAttrUI();
|
| | | SetLegendAttrUI();
|
| | | for (int i = 0; i < attrCutLinelist.Count; i++)
|
| | | {
|
| | | if (i == curAttrTypeNum - 1)
|
| | | {
|
| | | attrCutLinelist[curAttrTypeNum - 1].SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrCutLinelist[i].SetActive(true);
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | KnapsackTimeCDMgr.Instance.RefreshItemOverdueTimeAct -= RefreshRemainTime;
|
| | | }
|
| | |
|
| | | private void RefreshRemainTime(string guid)
|
| | | {
|
| | | if (guid != itemAttrData.guid)
|
| | | {
|
| | | return;
|
| | | }
|
| | | ItemCDCool cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(guid);
|
| | | if (cool != null)
|
| | | {
|
| | | SetDateLimitUI(cool.GetRemainTime());
|
| | | }
|
| | | else
|
| | | {
|
| | | SetDateLimitUI(0);
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetDateLimitUI(double time)
|
| | | {
|
| | | dateText.gameObject.SetActive(true);
|
| | | TimeSpan t = TimeSpan.FromSeconds(time);
|
| | | if (t.TotalDays > 1)
|
| | | {
|
| | | dateText.text = Language.Get("EquipInfo_OverdueDay", (int)t.TotalDays);
|
| | | }
|
| | | else if (t.TotalHours > 1)
|
| | | {
|
| | | dateText.text = Language.Get("EquipInfo_OverdueHour", (int)t.TotalHours);
|
| | | }
|
| | | else if (t.TotalMinutes > 1)
|
| | | {
|
| | | dateText.text = Language.Get("EquipInfo_OverdueMin", (int)t.TotalMinutes);
|
| | | }
|
| | | else if (t.TotalMinutes > 0)
|
| | | {
|
| | | dateText.text = Language.Get("EquipInfo_OverdueMin", 1);
|
| | | }
|
| | | else if (t.TotalSeconds <= 0)
|
| | | {
|
| | | dateText.text = Language.Get("EquipInfo_Overdued");
|
| | | }
|
| | | }
|
| | |
|
| | | #region 设置属性UI
|
| | | private void SetBasicAttrUI()
|
| | | {
|
| | | basicAttr.SetActive(true);
|
| | | basicTitleText.text = Language.Get("RolePanel_BaseAttrText_1");
|
| | | basicAttrDes.text = itemTipsModel.GetBasicAttr(itemAttrData);
|
| | | curAttrTypeNum = 1;
|
| | | }
|
| | |
|
| | | private void SetLegendAttrUI()
|
| | | {
|
| | | if (itemAttrData.legendDataDict == null)
|
| | | {
|
| | | legendAttr.SetActive(false);
|
| | | return;
|
| | | }
|
| | | curAttrTypeNum = 2;
|
| | | legendAttr.SetActive(true);
|
| | | legendTitleText.text = Language.Get("EquipWin_LegendPropObj_Text_1");
|
| | | legendAttrDes.text = itemTipsModel.GetLegendAttr(itemAttrData);
|
| | |
|
| | | if (itemAttrData.isPreview)
|
| | | {
|
| | | legendCntPreview.gameObject.SetActive(true);
|
| | | legendCntPreview.text = itemTipsModel.GetWingsLegendAttrCntPreview(itemAttrData);
|
| | | }
|
| | | else
|
| | | {
|
| | | legendCntPreview.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetMidUIHeight(float midHeight)
|
| | | {
|
| | | scrollRect.enabled = false;
|
| | |
|
| | | if (midHeight < itemTipsModel.equipMidHeights[0])
|
| | | {
|
| | | scrollLayout.preferredHeight = itemTipsModel.equipMidHeights[0];
|
| | | }
|
| | | else if (midHeight > itemTipsModel.equipMidHeights[1])
|
| | | {
|
| | | scrollRect.enabled = true;
|
| | | scrollLayout.preferredHeight = itemTipsModel.equipMidHeights[1];
|
| | | }
|
| | | else
|
| | | {
|
| | | scrollLayout.preferredHeight = midHeight;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OnClickGetItemBtn()
|
| | | {
|
| | | if (_getWaysTipsAlpha.alpha <= 0)
|
| | | {
|
| | | Vector3 pos = Vector3.zero;
|
| | | if (itemTipsModel.compareAttrData != null)
|
| | | {
|
| | | equipTipsObj.SetActive(false);
|
| | | pos = new Vector3(0, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | pos = new Vector3(this.GetComponent<RectTransform>().sizeDelta.x, 0, 0);
|
| | | }
|
| | | _itemInfoTips.DOAnchorPos3D(pos, _moveTime);
|
| | | _getWaysTipsAlpha.DOFade(1, _moveTime);
|
| | | closeBtn.gameObject.SetActive(false);
|
| | |
|
| | | CreateWayCell();
|
| | | }
|
| | | else
|
| | | {
|
| | | _itemInfoTips.DOAnchorPos3D(new Vector3(this.GetComponent<RectTransform>().sizeDelta.x, 0, 0), _moveTime);
|
| | | _getWaysTipsAlpha.DOFade(0, _moveTime);
|
| | | closeBtn.gameObject.SetActive(true);
|
| | | if (itemTipsModel.compareAttrData != null)
|
| | | {
|
| | | equipTipsObj.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void OnClickCloseBtn()
|
| | | {
|
| | | closeBtn.onClick.RemoveAllListeners();
|
| | | KnapSackEventMgr.Instance.HideItemPopWin();
|
| | | }
|
| | |
|
| | | #region getWaysTips逻辑
|
| | | private List<GetItemWaysConfig> getWayslist;
|
| | | protected virtual void CreateWayCell()
|
| | | {
|
| | | getWayslist = itemTipsModel.GetWaysList(itemAttrData);
|
| | | _waysCtrl.Refresh();
|
| | | int i = 0;
|
| | | int remain = getWayslist.Count % waysLineCell.childCount;
|
| | | int line = (int)getWayslist.Count / waysLineCell.childCount;
|
| | | if (remain > 0)
|
| | | {
|
| | | line += 1;
|
| | | }
|
| | |
|
| | | for (i = 0; i < line; i++)
|
| | | {
|
| | | _waysCtrl.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | _waysCtrl.Restart();
|
| | | }
|
| | |
|
| | | private void RefreshWayCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | int i = 0;
|
| | | for (i = 0; i < cell.transform.childCount; i++)
|
| | | {
|
| | | WayCell wayCell = cell.transform.GetChild(i).GetComponent<WayCell>();
|
| | | if (wayCell == null)
|
| | | wayCell = cell.transform.GetChild(i).gameObject.AddComponent<WayCell>();
|
| | |
|
| | | int index = (cell.transform.childCount) * cell.index + i;
|
| | | if (index <= getWayslist.Count - 1)
|
| | | {
|
| | | cell.transform.GetChild(i).gameObject.SetActive(true);
|
| | | GetItemWaysConfig itemWaysModel = getWayslist[index];
|
| | | wayCell.icon.SetSprite(itemWaysModel.Icon);
|
| | | wayCell.wayName.text = itemWaysModel.Text;
|
| | | wayCell.funcName.text = itemWaysModel.name;
|
| | | wayCell.wayButton.RemoveAllListeners();
|
| | | wayCell.wayButton.AddListener(() => {
|
| | | ClickWayCell(itemWaysModel);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | cell.transform.GetChild(i).gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void ClickWayCell(GetItemWaysConfig itemWaysModel)
|
| | | {
|
| | | OnClickCloseBtn();
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().ClickGetWay(itemAttrData.itemId, itemWaysModel);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a95419693c2992743b4e1127f6b4959c |
| | | timeCreated: 1540294742 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OfflineHangUpUseWin : Window
|
| | | {
|
| | | [SerializeField] Slider _batchUseSlider;
|
| | | [SerializeField] Text _number;
|
| | | [SerializeField] Button _addBtn;
|
| | | [SerializeField] Button _reduceBtn;
|
| | | [SerializeField] Button _useBtn;
|
| | | [SerializeField] Button _closeBtn;
|
| | | [SerializeField] Text offlineText;
|
| | | private ItemModel itemModel;
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | _addBtn.onClick.AddListener(OnClickAddBtn);
|
| | | _reduceBtn.onClick.AddListener(OnClickReduceBtn);
|
| | | _useBtn.onClick.AddListener(OnClickBatchUseBtn);
|
| | | _closeBtn.onClick.AddListener(CloseClick);
|
| | | _batchUseSlider.onValueChanged.AddListener(delegate
|
| | | {
|
| | | OnUseValueChange();
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void Display()
|
| | | {
|
| | | itemModel = playerPack.GetItemModelByGUID(BatchUseModel.Instance.offlineGuid);
|
| | | if (itemModel == null) return;
|
| | |
|
| | | int maxOfflineNum = PackSendQuestMgr.Instance.GetOfflineMaxNum(itemModel);
|
| | | _batchUseSlider.maxValue = maxOfflineNum;
|
| | | _batchUseSlider.minValue = 1;
|
| | | _batchUseSlider.value = _batchUseSlider.minValue;
|
| | | OnUseValueChange();
|
| | | }
|
| | |
|
| | | public void OnUseValueChange()
|
| | | {
|
| | | _number.text = Mathf.Ceil(_batchUseSlider.value).ToString();
|
| | | UpdateOfflineTime();
|
| | | }
|
| | |
|
| | | public void UpdateOfflineTime()
|
| | | {
|
| | | if (itemModel == null) return;
|
| | | offlineText.text = GetOfflinePluginTime();
|
| | | }
|
| | |
|
| | | public void OnClickAddBtn()
|
| | | {
|
| | | if (_batchUseSlider.value < _batchUseSlider.maxValue)
|
| | | {
|
| | | _batchUseSlider.value++;
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnClickReduceBtn()
|
| | | {
|
| | | if (_batchUseSlider.value > _batchUseSlider.minValue)
|
| | | {
|
| | | _batchUseSlider.value--;
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnClickBatchUseBtn()
|
| | | {
|
| | | if (itemModel == null)
|
| | | return;
|
| | | bool isMax = PackSendQuestMgr.Instance.CheckIsMaxOfflineTime((int)Mathf.Ceil(_batchUseSlider.value), itemModel);
|
| | | if(!isMax)
|
| | | {
|
| | | PackSendQuestMgr.Instance.SendMakeUseQuest(itemModel.itemInfo.ItemPlace, (int)Mathf.Ceil(_batchUseSlider.value));
|
| | | }
|
| | | CloseClick();
|
| | | }
|
| | |
|
| | | public string GetOfflinePluginTime()
|
| | | {
|
| | | TimeSpan timeSpan = TimeSpan.FromSeconds(HangUpSetModel.Instance.offlinePluginTime);
|
| | | string s = "";
|
| | | if (timeSpan.Hours > 0)
|
| | | {
|
| | | s = Language.Get("ItemOverdue103", timeSpan.Hours);
|
| | | }
|
| | | if (timeSpan.Minutes > 0)
|
| | | {
|
| | | s = StringUtility.Contact(s, Language.Get("ItemOverdue104", timeSpan.Minutes));
|
| | | }
|
| | |
|
| | | if (s == "")
|
| | | {
|
| | | s = Language.Get("ItemOverdue104", 0);
|
| | | }
|
| | |
|
| | | int addHour = (itemModel.chinItemModel.EffectValueA1 / 3600)* (int)Mathf.Ceil(_batchUseSlider.value);
|
| | | string addHourStr = UIHelper.GetTextColorByItemColor(TextColType.Green,StringUtility.Contact("+", Language.Get("ItemOverdue103", addHour)),true);
|
| | | s = StringUtility.Contact(s, addHourStr);
|
| | | return s;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5682063d28a2b244db79c05ce7f0075e |
| | | timeCreated: 1540449836 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public class RoleEquipWin : Window
|
| | | {
|
| | | #region 成员变量
|
| | | [SerializeField]
|
| | | private GameObject _beastArea; //灵守
|
| | | [SerializeField]
|
| | | private GameObject _helmetArea; //头盔
|
| | | [SerializeField]
|
| | | private GameObject _clothArea; //胸甲
|
| | | [SerializeField]
|
| | | private GameObject _pantsArea; //护腿
|
| | | [SerializeField]
|
| | | private GameObject _shoesArea; //鞋子
|
| | | [SerializeField]
|
| | | private GameObject _weaponArea; //武器
|
| | | [SerializeField]
|
| | | private GameObject _retWeapon2; //副手
|
| | | [SerializeField]
|
| | | private GameObject _fairy01Area; //圣器1
|
| | | [SerializeField]
|
| | | private GameObject _fairy02Area; //圣器2`
|
| | | [SerializeField]
|
| | | private GameObject _necklaceArea; //项链
|
| | | [SerializeField]
|
| | | private GameObject _beltArea; //腰带
|
| | | [SerializeField]
|
| | | private GameObject _wingsArea; //翅膀
|
| | | [SerializeField] List<EquipPlaceCell> equipPlaces = new List<EquipPlaceCell>();
|
| | |
|
| | | [SerializeField] RawImage RoleShowBG;
|
| | | [SerializeField]
|
| | | private Button _starCountBtn;
|
| | |
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
| | | }
|
| | |
|
| | | private FuncConfigConfig _equipPlaceModel;
|
| | | private List<string> _equipCodelist;
|
| | | private List<string> _equipNamelist;
|
| | | private RoleEquipType _equipType;
|
| | | private BagWin bagWin;
|
| | | private Dictionary<int,ItemModel> _roleEquipDict = new Dictionary<int,ItemModel>();
|
| | | private Dictionary<RoleEquipType ,GameObject> equipArealist = new Dictionary<RoleEquipType, GameObject>();
|
| | |
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel
|
| | |
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | | equipArealist.Add(RoleEquipType.retWeapon, _weaponArea);
|
| | | equipArealist.Add(RoleEquipType.retClothes, _clothArea);
|
| | | equipArealist.Add(RoleEquipType.retHat, _helmetArea);
|
| | | equipArealist.Add(RoleEquipType.retTrousers, _pantsArea);
|
| | | equipArealist.Add(RoleEquipType.retShoes, _shoesArea);
|
| | | equipArealist.Add(RoleEquipType.retNeck, _necklaceArea);
|
| | | equipArealist.Add(RoleEquipType.retWeapon2, _retWeapon2);
|
| | | equipArealist.Add(RoleEquipType.retFairyCan, _fairy01Area);
|
| | | equipArealist.Add(RoleEquipType.retFairyCan2, _fairy02Area);
|
| | | equipArealist.Add(RoleEquipType.retBelt, _beltArea);
|
| | | equipArealist.Add(RoleEquipType.retWing, _wingsArea);
|
| | | equipArealist.Add(RoleEquipType.retSpiritAnimal, _beastArea);
|
| | | _oneKeySellBtn.onClick.AddListener(OnClickOneKeySell);
|
| | | _sortBtn.onClick.AddListener(() => { OnClickSortBtn(); });
|
| | | }
|
| | |
| | |
|
| | | UIEventTrigger.Get(_starCountBtn.gameObject).OnDown = OnClickStarBtn;
|
| | | UIEventTrigger.Get(_equipIntensifyBtn.gameObject).OnDown = OnClickEquipIntensify;
|
| | | foreach (var go in equipArealist.Values)
|
| | | {
|
| | | GameObject itemCell = go.transform.Find("ItemCell").gameObject;
|
| | | itemCell.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | OnFrenshBagInfo();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptEquip);
|
| | | if(singlePack != null)
|
| | | {
|
| | | Dictionary<int,ItemModel> itemPlaceDict = singlePack.GetPackModelIndexDict();
|
| | | foreach (var model in itemPlaceDict.Values)
|
| | | {
|
| | | PutOnEquip(model.packType,model.itemInfo.ItemPlace,model.itemInfo.ItemID);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
|
| | | if(successConfig != null && successConfig.Type == 95)
|
| | | {
|
| | | playerPack.SetJumpToOneKeySell(_oneKeySellBtn.transform);
|
| | | }
|
| | |
|
| | | //if(playerPack.IsActiveSTRAttr())
|
| | | //{
|
| | | // ControlEffect(0,true);
|
| | | //}
|
| | |
|
| | | if(playerPack.IsActiveStarAttr())
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateRoleEquip(int equipPlace)
|
| | | {
|
| | | for (int i = 0; i < equipPlaces.Count; i++)
|
| | | {
|
| | | equipPlaces[i].Display(equipPlace);
|
| | | }
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | |
|
| | | public void PutOnEquip(PackType type,int index, int Id)
|
| | | {
|
| | | //临时条件判断
|
| | | if (type != PackType.rptEquip || !equipArealist.ContainsKey((RoleEquipType)index)) return;
|
| | | if (type != PackType.rptEquip) return;
|
| | |
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip,index);
|
| | | ItemCell itemCell = equipArealist[(RoleEquipType)index].transform.Find("ItemCell").GetComponent<ItemCell>();
|
| | | itemCell.gameObject.SetActive(true);
|
| | | itemCell.Init(itemModel);
|
| | | itemCell.cellBtn.onClick.RemoveAllListeners();
|
| | | itemCell.cellBtn.onClick.AddListener(()=> {
|
| | | itemTipsModel.SetItemTipsModel(PackType.rptEquip, itemModel.itemInfo.ItemGUID,false);
|
| | | itemTipsModel.SetPutOnTipsBtn(itemTipsModel.curAttrData);
|
| | | itemTipsModel.ShowUICtrl();
|
| | |
|
| | | });
|
| | |
|
| | | if (_roleEquipDict.ContainsKey(itemModel.itemInfo.ItemPlace))
|
| | | {
|
| | | _roleEquipDict[itemModel.itemInfo.ItemPlace] = itemModel;
|
| | | }
|
| | | else
|
| | | {
|
| | | _roleEquipDict.Add(itemModel.itemInfo.ItemPlace,itemModel);
|
| | | }
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | |
|
| | | UpdateRoleEquip(index);
|
| | | }
|
| | |
|
| | | public void PutOffEquip(PackType type, int place,int id)
|
| | | {
|
| | | if (type != PackType.rptEquip) return;
|
| | |
|
| | | ClearEquipInfo(place);
|
| | | equipArealist[(RoleEquipType)place].transform.Find("ItemCell").gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | UpdateRoleEquip(place);
|
| | | }
|
| | |
|
| | | private void OnClickEquipIntensify(GameObject go)
|
| | |
| | | {
|
| | | WindowCenter.Instance.Open<PlayerStarNumWin>();
|
| | | }
|
| | |
|
| | | public void ClearEquipInfo(int place)
|
| | | {
|
| | | if (_roleEquipDict.ContainsKey(place))
|
| | | {
|
| | | _roleEquipDict.Remove(place);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckEquipIfPutOn(int equipPlace)
|
| | | {
|
| | |
|
| | | if (_roleEquipDict.ContainsKey(equipPlace))
|
| | | return true;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | private List<string> GetToolsList(string tools, List<string> toolslist)
|
| | | {
|
| | | toolslist = new List<string>();
|
| | | string[] toolsArray = tools.Split('|');
|
| | | for (int i = 0; i < toolsArray.Length; i++)
|
| | | {
|
| | | toolslist.Add(toolsArray[i]);
|
| | | }
|
| | | return toolslist;
|
| | | }
|
| | |
|
| | | public void OnClickSortBtn()
|
| | | {
|
| | | modelInterface.SendPackResetQuest(PackType.rptItem);
|
| | |
| | | _sortBtn.enabled = false;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void RefreshTime(float time)
|
| | | {
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, September 07, 2017 |
| | | //-------------------------------------------------------- |
| | | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class WingsWin : Window |
| | | { |
| | | #region 成员变量 |
| | | [SerializeField] |
| | | WingsTip wingsTip; |
| | | [SerializeField] |
| | | BuyWingsTip buyTip; |
| | | [SerializeField] |
| | | CanvasGroup wingsTipAlpha; |
| | | [SerializeField] |
| | | CanvasGroup buyTipAlpha; |
| | | #endregion |
| | | ItemTipsModel _itemTipsModel; |
| | | ItemTipsModel itemTipsModel |
| | | { |
| | | get |
| | | { |
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); |
| | | } |
| | | } |
| | | |
| | | private List<GameObject> TempCreatelist = new List<GameObject>(); |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | KnapSackEventMgr.Instance.AddWingsWinTempObjEvent = AddTempCreatelist; |
| | | KnapSackEventMgr.Instance.HideWingsWinEvent = OnHidePanel; |
| | | wingsTipAlpha.alpha = 0; |
| | | buyTipAlpha.alpha = 0; |
| | | UIShow(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | this.transform.SetAsLastSibling(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | for (int i = 0; i < TempCreatelist.Count; i++) |
| | | { |
| | | Destroy(TempCreatelist[i]); |
| | | } |
| | | TempCreatelist.Clear(); |
| | | wingsTip.gameObject.SetActive(false); |
| | | buyTip.gameObject.SetActive(false); |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | public void UIShow() |
| | | { |
| | | if (itemTipsModel.compareAttrData == null) |
| | | { |
| | | if (itemTipsModel.curAttrData != null) |
| | | { |
| | | switch (itemTipsModel.curAttrData.ChildType) |
| | | { |
| | | case ItemTipChildType.Normal: |
| | | wingsTip.InitModel(itemTipsModel.curAttrData); |
| | | wingsTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.Buy: |
| | | buyTip.InitModel(itemTipsModel.curAttrData); |
| | | buyTip.gameObject.SetActive(true); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (itemTipsModel.curAttrData != null) |
| | | { |
| | | switch (itemTipsModel.curAttrData.ChildType) |
| | | { |
| | | case ItemTipChildType.Normal: |
| | | |
| | | WingsTip compareTip = CloneEquipUI(this.transform, wingsTip.gameObject).GetComponent<WingsTip>(); |
| | | compareTip.InitModel(itemTipsModel.compareAttrData); |
| | | TempCreatelist.Add(compareTip.gameObject); |
| | | wingsTip.InitModel(itemTipsModel.curAttrData); |
| | | compareTip.gameObject.SetActive(true); |
| | | wingsTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.Buy: |
| | | buyTip.InitModel(itemTipsModel.curAttrData); |
| | | wingsTip.InitModel(itemTipsModel.compareAttrData); |
| | | buyTip.gameObject.SetActive(true); |
| | | wingsTip.gameObject.SetActive(true); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | private void AddTempCreatelist(GameObject obj) |
| | | { |
| | | TempCreatelist.Add(obj); |
| | | } |
| | | |
| | | public GameObject CloneEquipUI(Transform parent, GameObject target) |
| | | { |
| | | GameObject go = Instantiate(target); |
| | | go.transform.SetParent(parent); |
| | | go.transform.localPosition = Vector3.zero; |
| | | go.transform.localScale = Vector3.one; |
| | | return go; |
| | | } |
| | | |
| | | public void OnHidePanel() |
| | | { |
| | | CloseImmediately(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, September 07, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class WingsWin : Window
|
| | | {
|
| | | #region 成员变量
|
| | | [SerializeField]
|
| | | WingsTip wingsTip;
|
| | | [SerializeField]
|
| | | BuyWingsTip buyTip;
|
| | | [SerializeField] GetWingsPathTips getWingsPathTip;
|
| | | [SerializeField]
|
| | | CanvasGroup wingsTipAlpha;
|
| | | [SerializeField]
|
| | | CanvasGroup buyTipAlpha;
|
| | | [SerializeField] CanvasGroup wingsPathAlpha;
|
| | | #endregion
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | private List<GameObject> TempCreatelist = new List<GameObject>();
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | KnapSackEventMgr.Instance.AddWingsWinTempObjEvent = AddTempCreatelist;
|
| | | KnapSackEventMgr.Instance.HideWingsWinEvent = OnHidePanel;
|
| | | itemTipsModel.SetCurTips(null);
|
| | | itemTipsModel.SetCompareTips(null);
|
| | | wingsTipAlpha.alpha = 0;
|
| | | buyTipAlpha.alpha = 0;
|
| | | wingsPathAlpha.alpha = 0;
|
| | | UIShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | this.transform.SetAsLastSibling();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | for (int i = 0; i < TempCreatelist.Count; i++)
|
| | | {
|
| | | Destroy(TempCreatelist[i]);
|
| | | }
|
| | | TempCreatelist.Clear();
|
| | | wingsTip.gameObject.SetActive(false);
|
| | | buyTip.gameObject.SetActive(false);
|
| | | getWingsPathTip.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void UIShow()
|
| | | {
|
| | | if (itemTipsModel.compareAttrData == null)
|
| | | {
|
| | | if (itemTipsModel.curAttrData != null)
|
| | | {
|
| | | switch (itemTipsModel.curAttrData.ChildType)
|
| | | {
|
| | | case ItemTipChildType.Normal:
|
| | | wingsTip.InitModel(itemTipsModel.curAttrData);
|
| | | wingsTip.gameObject.SetActive(true);
|
| | | break;
|
| | | case ItemTipChildType.Buy:
|
| | | buyTip.InitModel(itemTipsModel.curAttrData);
|
| | | buyTip.gameObject.SetActive(true);
|
| | | break;
|
| | | case ItemTipChildType.GetWingsPath:
|
| | | getWingsPathTip.InitModel(itemTipsModel.curAttrData);
|
| | | getWingsPathTip.gameObject.SetActive(true);
|
| | | break;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemTipsModel.curAttrData != null)
|
| | | {
|
| | | switch (itemTipsModel.curAttrData.ChildType)
|
| | | {
|
| | | case ItemTipChildType.Normal:
|
| | | |
| | | WingsTip compareTip = CloneEquipUI(this.transform, wingsTip.gameObject).GetComponent<WingsTip>();
|
| | | compareTip.InitModel(itemTipsModel.compareAttrData);
|
| | | TempCreatelist.Add(compareTip.gameObject);
|
| | | wingsTip.InitModel(itemTipsModel.curAttrData);
|
| | | compareTip.gameObject.SetActive(true);
|
| | | wingsTip.gameObject.SetActive(true);
|
| | | break;
|
| | | case ItemTipChildType.Buy:
|
| | | buyTip.InitModel(itemTipsModel.curAttrData);
|
| | | wingsTip.InitModel(itemTipsModel.compareAttrData);
|
| | | buyTip.gameObject.SetActive(true);
|
| | | wingsTip.gameObject.SetActive(true);
|
| | | break;
|
| | | case ItemTipChildType.GetWingsPath:
|
| | | getWingsPathTip.InitModel(itemTipsModel.curAttrData);
|
| | | getWingsPathTip.gameObject.SetActive(true);
|
| | | wingsTip.InitModel(itemTipsModel.compareAttrData);
|
| | | wingsTip.gameObject.SetActive(true);
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void AddTempCreatelist(GameObject obj)
|
| | | {
|
| | | TempCreatelist.Add(obj);
|
| | | }
|
| | |
|
| | | public GameObject CloneEquipUI(Transform parent, GameObject target)
|
| | | {
|
| | | GameObject go = Instantiate(target);
|
| | | go.transform.SetParent(parent);
|
| | | go.transform.localPosition = Vector3.zero;
|
| | | go.transform.localScale = Vector3.one;
|
| | | return go;
|
| | | }
|
| | |
|
| | | public void OnHidePanel()
|
| | | {
|
| | | CloseImmediately();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var sprite = Resources.Load<Sprite>("UI/Sprites/LoginBackGround");
|
| | | var sprite = BuiltInLoader.LoadSprite("LoginBackGround");
|
| | | useStaticBackGround = sprite != null;
|
| | |
|
| | | if (useStaticBackGround)
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | var sprite = Resources.Load<Sprite>("UI/Sprites/Launch");
|
| | | var sprite = BuiltInLoader.LoadSprite("Launch");
|
| | | m_BackGround.overrideSprite = sprite;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_UserHelp.SetListener(OpenUserHelp);
|
| | | if (m_UserHelp)
|
| | | {
|
| | | m_UserHelp.SetListener(OpenUserHelp);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | m_Version.text = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex);
|
| | | m_BuildTime.text = VersionConfig.Get().debugVersion ? VersionConfig.Get().buildTime : "";
|
| | |
|
| | | m_UserHelp.gameObject.SetActive(Config.Instance.ContainKey<ContactConfig>(VersionConfig.Get().appId));
|
| | | if (m_UserHelp)
|
| | | {
|
| | | var appId = VersionConfig.Get().appId;
|
| | | var branch = VersionConfig.Get().branch;
|
| | | m_UserHelp.gameObject.SetActive(ContactConfig.GetConfig(appId, branch) != null);
|
| | | }
|
| | |
|
| | | if (Application.platform == RuntimePlatform.IPhonePlayer)
|
| | | {
|
| | |
| | | m_ServerSelect.SetListener(OpenServerListWin);
|
| | | m_SwitchAccount.SetListener(SwitchAccount);
|
| | | m_Notice.SetListener(VeiwNotice);
|
| | | m_UserHelp.SetListener(OpenUserHelp);
|
| | | if (m_UserHelp)
|
| | | {
|
| | | m_UserHelp.SetListener(OpenUserHelp);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_BanHao.text = string.IsNullOrEmpty(VersionConfig.Get().banHao) ? string.Empty : VersionConfig.Get().banHao;
|
| | |
|
| | | var sprite = Resources.Load<Sprite>("UI/Sprites/TB_DL_Logo");
|
| | | var sprite = BuiltInLoader.LoadSprite("TB_DL_Logo");
|
| | | m_Logo.overrideSprite = sprite;
|
| | | m_Logo.SetNativeSize();
|
| | | m_Logo.rectTransform.anchoredPosition = VersionConfig.Get().logoPosition;
|
| | |
| | | m_AlphaTween.SetStartState();
|
| | | m_SwitchAccount.gameObject.SetActive(VersionConfig.Get().versionAuthority == VersionAuthority.Release && !VersionConfig.Get().isBanShu);
|
| | |
|
| | | m_UserHelp.gameObject.SetActive(Config.Instance.ContainKey<ContactConfig>(VersionConfig.Get().appId));
|
| | | if (m_UserHelp)
|
| | | {
|
| | | var appId = VersionConfig.Get().appId;
|
| | | var branch = VersionConfig.Get().branch;
|
| | | m_UserHelp.gameObject.SetActive(ContactConfig.GetConfig(appId, branch) != null);
|
| | | }
|
| | |
|
| | | m_WaitServerList.gameObject.SetActive(!ServerListCenter.Instance.serverListGot);
|
| | | m_ContainerEnterGame.gameObject.SetActive(ServerListCenter.Instance.serverListGot);
|
| | |
| | | }
|
| | | break;
|
| | | case LoginAdCondition.ImpactRank:
|
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(0))
|
| | | if (!impactRankModel.IsInImpactRank)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
| | | [SerializeField] Button m_RedBag;//红包入口按钮
|
| | | [SerializeField] UIEffect m_RedpackGetSfx;
|
| | | [SerializeField] Button m_SendRedbagBtn;
|
| | | [SerializeField] Button WishingAwardImg;
|
| | | [SerializeField] Button m_GotoFairyGrabBoss;
|
| | |
|
| | | [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
|
| | | private int m_CollectNPCID;
|
| | |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
|
| | |
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | fairyRequestBtn.onClick.AddListener(OnFairyRequestClick);
|
| | | m_RedBag.AddListener(RedPacketButton);
|
| | | m_SendRedbagBtn.AddListener(SendRedpacketBtn);
|
| | | WishingAwardImg.AddListener(ClickWishAward);
|
| | | m_GotoFairyGrabBoss.AddListener(GotoFairyGrabBoss);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | m_TeamInvitationEntrance.Init();
|
| | | m_FairyCallBehaviour.Init();
|
| | | m_BossBriefInfos.gameObject.SetActive(false);
|
| | |
|
| | | UpdateWishAwardImag();
|
| | | ArticleExperience();//关于经验条
|
| | | FriendQuestBtn();
|
| | | UpdateFairyRequest();
|
| | | OnRedBagGet();//关于红包入口
|
| | | CheckSendRedpackBtn();
|
| | | CheckChatTipOpen();
|
| | | ShowFairyGrabBoss();
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;
|
| | | FunctionUnlockFlyObject.functionUnLockShowBeginEvent += UnFlodFunctionArea;
|
| | | fairyModel.UpdateFairyRequestEvent += UpdateFairyRequest;
|
| | |
| | | RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent;
|
| | | NewBieCenter.Instance.guideBeginEvent += GuideBeginEvent;
|
| | | fairyGrabBossModel.bossGrabHintEvent += bossGrabHintEvent;
|
| | | wishModel.UpdateWishAwardEvent += UpdateWishAwardImag;
|
| | | fairyGrabBossModel.gotoBossStateUpdate += ShowFairyGrabBoss;
|
| | | }
|
| | |
|
| | | private void CompletionOfTaskEvent(int obj)
|
| | |
| | | if (isNeutralMap)
|
| | | {
|
| | | m_BossBriefInfos.gameObject.SetActive(true);
|
| | | if (PlayerDatas.Instance.baseData.MapID==DogzDungeonModel.DATA_MAPID)
|
| | | if (PlayerDatas.Instance.baseData.MapID == DogzDungeonModel.DATA_MAPID)
|
| | | {
|
| | | var bosses = ModelCenter.Instance.GetModel<DogzDungeonModel>().GetBosses();
|
| | | m_BossBriefInfos.Display(bosses);
|
| | |
| | | PlayerTaskDatas.CompletionOfTaskEvent -= CompletionOfTaskEvent;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | | NewBieCenter.Instance.guideBeginEvent -= GuideBeginEvent;
|
| | | fairyGrabBossModel.gotoBossStateUpdate -= ShowFairyGrabBoss;
|
| | | if (WindowCenter.Instance.IsOpen<FunctionForecastWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<FunctionForecastWin>();
|
| | |
| | | GA_NpcCollect.OnArrive -= OnArriveCollectNPC;
|
| | | GA_NpcCollect.OnLeave -= OnLeaveCollectNpc;
|
| | | fairyGrabBossModel.bossGrabHintEvent -= bossGrabHintEvent;
|
| | | wishModel.UpdateWishAwardEvent -= UpdateWishAwardImag;
|
| | | m_CollectBtn.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void ClickWishAward()
|
| | | {
|
| | | WindowCenter.Instance.Open<WishingGetItemWin>();
|
| | | }
|
| | |
|
| | | private void UpdateWishAwardImag()
|
| | | {
|
| | | WishingAwardImg.gameObject.SetActive(wishModel.wishingAwardDict.Count > 0 ? true : false);
|
| | | }
|
| | |
|
| | | private void UpdateFairyRequest()
|
| | | {
|
| | | fairyRequestBtn.gameObject.SetActive(fairyModel.FairyRequestRedPoint.count > 0);
|
| | |
| | | void DownButton(GameObject go)
|
| | | {
|
| | | _ExpRate.gameObject.SetActive(true);
|
| | | // WindowCenter.Instance.Open<WheelOfFortuneWin>();
|
| | | // WindowCenter.Instance.Open<WheelOfFortuneWin>();
|
| | | }
|
| | | void UpButton(GameObject go)
|
| | | {
|
| | |
| | | private void bossGrabHintEvent()
|
| | | {
|
| | | IsShowTaskPanel();
|
| | | ShowFairyGrabBoss();
|
| | | }
|
| | |
|
| | | private void ShowFairyGrabBoss()
|
| | | {
|
| | | m_GotoFairyGrabBoss.gameObject.SetActive(fairyGrabBossModel.cacheGotoBossId != 0 &&
|
| | | !fairyGrabBossModel.grabBossHintOpen);
|
| | | }
|
| | |
|
| | | private void GotoFairyGrabBoss()
|
| | | {
|
| | | if (fairyGrabBossModel.cacheGotoBossId != 0)
|
| | | {
|
| | | var error = 0;
|
| | | if (fairyGrabBossModel.TestEnterDungeon(fairyGrabBossModel.cacheGotoBossId, out error))
|
| | | {
|
| | | if (fairyGrabBossModel.IsBossKilled(fairyGrabBossModel.cacheGotoBossId))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FairyGrabBossOver");
|
| | | }
|
| | | MapTransferUtility.Instance.MoveToNPC(fairyGrabBossModel.cacheGotoBossId);
|
| | | }
|
| | | else
|
| | | {
|
| | | fairyGrabBossModel.DisplayErrorTip(error);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | case StoreFunc.OSGift:
|
| | | {
|
| | | if (giftModel.IsGiftOverdue(_storeConfig.ID))
|
| | | if (!giftModel.IsGiftExist(_storeConfig.ID))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | |
| | | {
|
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | ParseConfig();
|
| | | storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | | vipModel.firstChargeRewardEvent += FirstChargeRewardEvent;
|
| | | OpenServerActivityCenter.Instance.Register(6, this);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | startSeconds = 0;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | activate = CheckActivate();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(6);
|
| | |
| | | }
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | | public event Action timeLimitUpdate;
|
| | | public event Action onSelectUpdate;
|
| | |
|
| | | public bool activate { get; private set; }
|
| | |
|
| | | StoreModel storeModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return ModelCenter.Instance.GetModel<StoreModel>();
|
| | | }
|
| | | }
|
| | |
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return CheckActivate();
|
| | | return IsExist();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | return OSGiftRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshBuyShopLimitEvent()
|
| | | {
|
| | | bool _activate = CheckActivate();
|
| | | if (activate != _activate)
|
| | | {
|
| | | activate = _activate;
|
| | | if (onStateUpate != null)
|
| | | for (int i = 0; i < redpoints.Count; i++)
|
| | | {
|
| | | onStateUpate(6);
|
| | | if (redpoints[i].state == RedPointState.Simple)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | UpdateRedpoint();
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public int timeOverdueGiftId { get; private set; }
|
| | |
|
| | | public bool IsAdvance
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public DateTime overDueTime = DateTime.Now;
|
| | | int m_SelectIndex = 0;
|
| | | public int selectIndex
|
| | | {
|
| | | get { return m_SelectIndex; }
|
| | | set
|
| | | {
|
| | | if (value != m_SelectIndex)
|
| | | {
|
| | | m_SelectIndex = value;
|
| | | if (onSelectUpdate != null)
|
| | | {
|
| | | onSelectUpdate();
|
| | | }
|
| | | }
|
| | | m_SelectIndex = value;
|
| | | }
|
| | | }
|
| | |
|
| | | public int jumpGiftId { get; set; }
|
| | |
|
| | | public List<SuperValueGift> gifts { get; private set; }
|
| | | public List<int> alreadyOpens { get; private set; }
|
| | | void ParseConfig()
|
| | | {
|
| | | gifts = new List<SuperValueGift>();
|
| | | alreadyOpens = new List<int>();
|
| | | var config = Config.Instance.Get<FuncConfigConfig>("SuperGiftTimeList");
|
| | | var array = LitJson.JsonMapper.ToObject<int[][]>(config.Numerical1);
|
| | | for (int i = 0; i < array.Length; i++)
|
| | | {
|
| | | gifts.Add(new SuperValueGift()
|
| | | {
|
| | | giftId = array[i][0],
|
| | | openDays = array[i][1],
|
| | | });
|
| | | }
|
| | |
|
| | | for (int i = 0; i < gifts.Count; i++)
|
| | | {
|
| | | redpoints.Add(new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20906 * 100 + i));
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshBuyShopLimitEvent()
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public uint startSeconds { get; private set; }
|
| | | public void UpdateTime(HAA16_tagMCSuperGiftInfo package)
|
| | | {
|
| | | timeOverdueGiftId = (int)package.GiftID;
|
| | | overDueTime = ParseOverdueTime(package.EndtDate);
|
| | | bool _activate = CheckActivate();
|
| | | if (activate != _activate)
|
| | | startSeconds = package.StartTime;
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | activate = _activate;
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | | if (timeLimitUpdate != null)
|
| | | {
|
| | | timeLimitUpdate();
|
| | | onStateUpate(6);
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | DateTime ParseOverdueTime(string _date)
|
| | | public bool IsExist()
|
| | | {
|
| | | var array = _date.Split('-');
|
| | | var year = int.Parse(array[0]);
|
| | | var month = int.Parse(array[1]);
|
| | | var day = int.Parse(array[2]);
|
| | | var time = new DateTime(year, month, day, 0, 0, 0);
|
| | | return time.AddDays(1);
|
| | | }
|
| | |
|
| | | private void FirstChargeRewardEvent()
|
| | | {
|
| | | bool _activate = CheckActivate();
|
| | | if (activate != _activate)
|
| | | for (int i = 0; i < gifts.Count; i++)
|
| | | {
|
| | | activate = _activate;
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public bool CheckActivate()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.coinPointTotal == 0
|
| | | || !ModelCenter.Instance.GetModel<VipModel>().firstChargeRewardGet)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | List<StoreConfig> _list = null;
|
| | | StoreConfig.TryGetStoreConfigs((int)StoreFunc.OSGift,out _list);
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | if (IsGiftOverdue(_list[i].ID))
|
| | | if (!IsGiftExist(gifts[i].giftId))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var _limit = storeModel.GetBuyShopLimit((uint)_list[i].ID);
|
| | | if (_limit == null || _limit.BuyCnt < _list[i].PurchaseNumber[0])
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsGiftOverdue(int _id)
|
| | | public bool IsGiftExist(int _id)
|
| | | {
|
| | | if (_id == timeOverdueGiftId)
|
| | | if (startSeconds == 0)
|
| | | {
|
| | | return TimeUtility.ServerNow >= overDueTime;
|
| | | return false;
|
| | | }
|
| | | var gift = gifts.Find((x) =>
|
| | | {
|
| | | return x.giftId == _id;
|
| | | });
|
| | | if (!gift.Equals(default(SuperValueGift)))
|
| | | {
|
| | | var startTime = TimeUtility.GetTime(startSeconds);
|
| | | var endTime = startTime.AddDays(gift.openDays);
|
| | | endTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 0, 0, 0);
|
| | | return TimeUtility.ServerNow < endTime;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh _type)
|
| | | public void SetAreadyOpens()
|
| | | {
|
| | | bool _activate = CheckActivate();
|
| | | if (_type == PlayerDataRefresh.ChangeCoinPointTotal && activate != _activate)
|
| | | alreadyOpens.Clear();
|
| | | for (int i = 0; i < gifts.Count; i++)
|
| | | {
|
| | | activate = _activate;
|
| | | if (onStateUpate != null)
|
| | | if (IsGiftExist(gifts[i].giftId))
|
| | | {
|
| | | onStateUpate(6);
|
| | | alreadyOpens.Add(i);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | public int GetDefaultSelect()
|
| | | {
|
| | | timeOverdueGiftId = 0;
|
| | | for (int i = 0; i < alreadyOpens.Count; i++)
|
| | | {
|
| | | if (gifts[i].giftId == jumpGiftId)
|
| | | {
|
| | | jumpGiftId = 0;
|
| | | return alreadyOpens[i];
|
| | | }
|
| | | }
|
| | | jumpGiftId = 0;
|
| | | for (int i = 0; i < alreadyOpens.Count; i++)
|
| | | {
|
| | | if (redpoints[alreadyOpens[i]].state == RedPointState.Simple)
|
| | | {
|
| | | return alreadyOpens[i];
|
| | | }
|
| | | }
|
| | | return alreadyOpens[0];
|
| | | }
|
| | |
|
| | | public void SetDayRemind()
|
| | | bool GetDayRemind(int index)
|
| | | {
|
| | | if (OSGiftRedpoint.state == RedPointState.Simple)
|
| | | return LocalSave.GetInt(StringUtility.Contact("OSGift_", index, "_",
|
| | | PlayerDatas.Instance.baseData.PlayerID), 0) == TimeUtility.Day;
|
| | | }
|
| | |
|
| | | public void SetDayRemind(int index)
|
| | | {
|
| | | if (redpoints[index].state == RedPointState.Simple)
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.OSGIFT_REDPOINT, true);
|
| | | LocalSave.SetInt(StringUtility.Contact("OSGift_", index, "_",
|
| | | PlayerDatas.Instance.baseData.PlayerID), TimeUtility.Day);
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | List<Redpoint> redpoints = new List<Redpoint>();
|
| | |
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | OSGiftRedpoint.state = RedPointState.None;
|
| | | if (CheckActivate() && !DayRemind.Instance.GetDayRemind(DayRemind.OSGIFT_REDPOINT))
|
| | | for (int i = 0; i < redpoints.Count; i++)
|
| | | {
|
| | | OSGiftRedpoint.state = RedPointState.Simple;
|
| | | redpoints[i].state = RedPointState.None;
|
| | | if (IsGiftExist(gifts[i].giftId) && !IsGiftBuy(gifts[i].giftId)
|
| | | && !GetDayRemind(i))
|
| | | {
|
| | | redpoints[i].state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public Redpoint OSGiftRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20906);
|
| | | public struct SuperValueGift
|
| | | {
|
| | | public int giftId;
|
| | | public int openDays;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | |
| | | [SerializeField] UIEffect m_TitleEffect;
|
| | | public UIEffect titleEffect { get { return m_TitleEffect; } }
|
| | |
|
| | | private int m_Order = 0;
|
| | | public int order { get { return m_Order; } set { m_Order = value; } }
|
| | | private int m_ActivityType = 0;
|
| | | public int activityType { get { return m_ActivityType; } set { m_ActivityType = value; } }
|
| | |
|
| | | public void ChangeState(TitleBtnState _state)
|
| | | {
|
| | |
| | | Dictionary<int, bool> m_ActivitySpreadDict = new Dictionary<int, bool>();
|
| | |
|
| | | ImpactRankModel m_ImpactRankModel;
|
| | | ImpactRankModel impactRankModel {
|
| | | get {
|
| | | ImpactRankModel impactRankModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_ImpactRankModel ?? (m_ImpactRankModel = ModelCenter.Instance.GetModel<ImpactRankModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | OSRedEnvelopeModel m_OSRedEnvelopeModel;
|
| | | OSRedEnvelopeModel envelopeModel {
|
| | | get {
|
| | | OSRedEnvelopeModel envelopeModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_OSRedEnvelopeModel ?? (m_OSRedEnvelopeModel = ModelCenter.Instance.GetModel<OSRedEnvelopeModel>());
|
| | | }
|
| | | }
|
| | | FairyLeagueModel fairyLeagueModel { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | OSGiftModel giftModel { get { return ModelCenter.Instance.GetModel<OSGiftModel>(); } }
|
| | |
|
| | | List<int> openActivitys = new List<int>();
|
| | | List<int> priorityActivitys = new List<int>();
|
| | |
| | | {
|
| | | m_ActivitySpreadDict[(int)m_CustomActivitys[i].activityType] = false;
|
| | | }
|
| | | var impactDefaultType= impactRankModel.GetDefaultSelectType();
|
| | | var impactDefaultType = impactRankModel.GetDefaultSelectType();
|
| | | if (impactRankModel.IsLock(impactDefaultType))
|
| | | {
|
| | | impactDefaultType = impactRankModel.billRankCfgDict.Keys.First();
|
| | |
| | | impactRankModel.presentSelectType = impactDefaultType;
|
| | | impactRankModel.gotoImpactRankType = 0;
|
| | | envelopeModel.selectType = 1;
|
| | | giftModel.SetAreadyOpens();
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | CheckAlreadyOpen();
|
| | | UpdateFunctionBtns();
|
| | |
| | | envelopeModel.selectType = envelopeModel.JumpType != 0 ? envelopeModel.JumpType : 1;
|
| | | envelopeModel.JumpType = 0;
|
| | | }
|
| | | if (functionOrder == 6)
|
| | | {
|
| | | giftModel.selectIndex = giftModel.GetDefaultSelect();
|
| | | }
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | OnOpenActivity(functionOrder);
|
| | |
|
| | | var index = functionOrder;
|
| | | if (alreadyOpenActivitys.Contains(6))
|
| | | {
|
| | | if (functionOrder > 6)
|
| | | {
|
| | | index = functionOrder + giftModel.alreadyOpens.Count - 1;
|
| | | }
|
| | | else if (functionOrder == 6)
|
| | | {
|
| | | index = functionOrder + giftModel.selectIndex;
|
| | | }
|
| | | }
|
| | | m_ActivityCtrl.JumpIndex(index);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | {
|
| | | case OpenServerActivityCenter.OSActivityType.OSRedpack:
|
| | | envelopeModel.selectType = envelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple ? 1 : 2;
|
| | | break;
|
| | | case OpenServerActivityCenter.OSActivityType.OSGift:
|
| | | giftModel.selectIndex = giftModel.GetDefaultSelect();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | private void RefreshOpenActivityCell(OpenServerActivityCell _cell)
|
| | | {
|
| | | var activityType = 0;
|
| | | activityType = _cell.index >= 1000 ? _cell.index / 1000 : _cell.index;
|
| | | var extraValue = _cell.index % 1000;
|
| | |
|
| | | var customActivity = m_CustomActivitys.Find((x) =>
|
| | | {
|
| | | return (int)x.activityType == _cell.index;
|
| | | return (int)x.activityType == activityType;
|
| | | });
|
| | | bool customIcon = !string.IsNullOrEmpty(customActivity.titleIcon);
|
| | |
|
| | | bool customIcon = !string.IsNullOrEmpty(customActivity.titleIcon)
|
| | | || (customActivity.titleIcons != null && customActivity.titleIcons.Count > 0);
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | |
|
| | | OperationBase operationBase;
|
| | | switch (_cell.index)
|
| | | switch (activityType)
|
| | | {
|
| | | case 5:
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.MultipleExp, out operationBase))
|
| | |
| | | break;
|
| | | default:
|
| | | _cell.title.gameObject.SetActive(!customIcon);
|
| | | _cell.title.text = Language.Get(StringUtility.Contact("OSActivityTitle_", _cell.index));
|
| | | if (!customIcon)
|
| | | {
|
| | | _cell.title.text = Language.Get(StringUtility.Contact("OSActivityTitle_", _cell.index));
|
| | | }
|
| | | break;
|
| | | }
|
| | | _cell.order = _cell.index;
|
| | | _cell.redpoint.redpointId = MainRedDot.REDPOINT_OPENSERVER * 100 + _cell.index;
|
| | | _cell.ChangeState(_cell.order == functionOrder ? TitleBtnState.Click : TitleBtnState.Normal);
|
| | |
|
| | | _cell.activityType = activityType;
|
| | |
|
| | | _cell.titleImage.gameObject.SetActive(customIcon);
|
| | | _cell.titleEffect.StopImediatly();
|
| | | switch (activityType)
|
| | | {
|
| | | case 6:
|
| | | _cell.redpoint.redpointId = 20906 * 100 + extraValue;
|
| | | _cell.ChangeState(extraValue == giftModel.selectIndex && functionOrder == activityType
|
| | | ? TitleBtnState.Click : TitleBtnState.Normal);
|
| | | if (customIcon)
|
| | | {
|
| | | _cell.titleImage.SetSprite(customActivity.titleIcons[extraValue]);
|
| | | _cell.titleImage.SetNativeSize();
|
| | | }
|
| | | if (customActivity.titleEffectIds != null && extraValue < customActivity.titleEffectIds.Count)
|
| | | {
|
| | | _cell.titleEffect.effect = customActivity.titleEffectIds[extraValue];
|
| | | _cell.titleEffect.Play();
|
| | | }
|
| | | break;
|
| | | default:
|
| | | _cell.redpoint.redpointId = MainRedDot.REDPOINT_OPENSERVER * 100 + activityType;
|
| | | _cell.ChangeState(_cell.activityType == functionOrder ? TitleBtnState.Click : TitleBtnState.Normal);
|
| | | if (customIcon)
|
| | | {
|
| | | _cell.titleImage.SetSprite(customActivity.titleIcon);
|
| | | _cell.titleImage.SetNativeSize();
|
| | | }
|
| | | if (customActivity.titleEffectId != 0)
|
| | | {
|
| | | _cell.titleEffect.effect = customActivity.titleEffectId;
|
| | | _cell.titleEffect.Play();
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | _cell.downArrow.gameObject.SetActive(false);
|
| | | _cell.upArrow.gameObject.SetActive(false);
|
| | |
|
| | | _cell.titleImage.gameObject.SetActive(customIcon);
|
| | | if (customIcon)
|
| | | if (_cell.activityType == 0 || _cell.activityType == 2)
|
| | | {
|
| | | _cell.titleImage.SetSprite(customActivity.titleIcon);
|
| | | _cell.titleImage.SetNativeSize();
|
| | | }
|
| | | _cell.titleEffect.StopImediatly();
|
| | | if (customActivity.titleEffectId != 0)
|
| | | {
|
| | | _cell.titleEffect.effect = customActivity.titleEffectId;
|
| | | _cell.titleEffect.Play();
|
| | | _cell.downArrow.gameObject.SetActive(m_ActivitySpreadDict[_cell.activityType]);
|
| | | _cell.upArrow.gameObject.SetActive(!m_ActivitySpreadDict[_cell.activityType]);
|
| | | }
|
| | |
|
| | | if (_cell.order == 0 || _cell.order == 2)
|
| | | {
|
| | | _cell.downArrow.gameObject.SetActive(m_ActivitySpreadDict[_cell.order]);
|
| | | _cell.upArrow.gameObject.SetActive(!m_ActivitySpreadDict[_cell.order]);
|
| | | }
|
| | | _cell.funcBtn.onClick.RemoveAllListeners();
|
| | | _cell.funcBtn.onClick.AddListener(() =>
|
| | | {
|
| | | OnActivityClick(_cell.order);
|
| | | OnActivityClick(_cell.activityType, extraValue);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + 1);
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + 2);
|
| | | break;
|
| | | case 6:
|
| | | for (int k = 0; k < giftModel.alreadyOpens.Count; k++)
|
| | | {
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort * 1000 + giftModel.alreadyOpens[k]);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort);
|
| | | break;
|
| | |
| | | m_ActivityCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | private void OnActivityClick(int _order)
|
| | | private void OnActivityClick(int _order, int extra = 0)
|
| | | {
|
| | | if (functionOrder == _order)
|
| | | if (functionOrder == _order && _order != 6)
|
| | | {
|
| | | m_ActivitySpreadDict[_order] = !m_ActivitySpreadDict[_order];
|
| | | UpdateFunctionBtns();
|
| | |
| | | m_ActivitySpreadDict[functionOrder] = false;
|
| | | m_ActivitySpreadDict[_order] = true;
|
| | | }
|
| | | functionOrder = _order;
|
| | | OnOpenActivity(functionOrder);
|
| | |
|
| | | if (functionOrder != _order)
|
| | | {
|
| | | functionOrder = _order;
|
| | | OnOpenActivity(functionOrder);
|
| | | }
|
| | |
|
| | | switch (functionOrder)
|
| | | {
|
| | | case 6:
|
| | | giftModel.selectIndex = extra;
|
| | | break;
|
| | | }
|
| | |
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | |
|
| | |
| | | switch (_order)
|
| | | {
|
| | | case 0:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<ImpactRankWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<ImpactRankWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<ImpactRankWin>(true);
|
| | | break;
|
| | | case 1:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<ConsumeRebateWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<ConsumeRebateWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<ConsumeRebateWin>(true);
|
| | | break;
|
| | | case 2:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<OpenServerRedEnvelopeWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<OpenServerRedEnvelopeWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<OpenServerRedEnvelopeWin>(true);
|
| | | break;
|
| | | case 3:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<OSTimeLimitGiftWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<OSTimeLimitGiftWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<OSTimeLimitGiftWin>(true);
|
| | | break;
|
| | | case 4:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FlashSaleWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FlashSaleWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<FlashSaleWin>(true);
|
| | | break;
|
| | | case 5:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<MultipleExpWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<MultipleExpWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<MultipleExpWin>(true);
|
| | | break;
|
| | | case 6:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<OpenServerGiftWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<OpenServerGiftWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<OpenServerGiftWin>(true);
|
| | | break;
|
| | | case 7:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<LimitedTimePackageWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<LimitedTimePackageWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<LimitedTimePackageWin>(true);
|
| | | break;
|
| | | case 8:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<NPracticePointWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<NPracticePointWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<NPracticePointWin>(true);
|
| | | break;
|
| | | case 9:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<BossRebornWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<BossRebornWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<BossRebornWin>(true);
|
| | | break;
|
| | | case 10:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FairyJadeInvestmentWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyJadeInvestmentWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<FairyJadeInvestmentWin>(true);
|
| | | break;
|
| | | case 11:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<VipInvestWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<VipInvestWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<VipInvestWin>(true);
|
| | | break;
|
| | | case 12:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FairyLeagueNoticeWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyLeagueNoticeWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<FairyLeagueNoticeWin>(true);
|
| | | break;
|
| | | case 13:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FairyGrabBossNoticeWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyGrabBossNoticeWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<FairyGrabBossNoticeWin>(true);
|
| | | break;
|
| | | case 14:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FlashRushToBuyWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FlashRushToBuyWin>(true);
|
| | | }
|
| | | WindowCenter.Instance.Open<FlashRushToBuyWin>(true);
|
| | | break;
|
| | | case 15:
|
| | | WindowCenter.Instance.Open<WishingPoolWin>(true);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | WindowCenter.Instance.CloseImmediately<FairyLeagueNoticeWin>();
|
| | | WindowCenter.Instance.CloseImmediately<FairyGrabBossNoticeWin>();
|
| | | WindowCenter.Instance.CloseImmediately<FlashRushToBuyWin>();
|
| | | WindowCenter.Instance.CloseImmediately<WishingPoolWin>();
|
| | | }
|
| | |
|
| | | private int Compare(int order_x, int order_y)
|
| | |
| | | public OpenServerActivityCenter.OSActivityType activityType;
|
| | | public string titleIcon;
|
| | | public int titleEffectId;
|
| | |
|
| | | public List<string> titleIcons;
|
| | | public List<int> titleEffectIds;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public class OpenServerGiftWin : Window
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerDisplay;
|
| | | [SerializeField] Button[] m_CloseBtns;
|
| | | [SerializeField] OSGiftBehaviour[] m_OSGifts;
|
| | | [SerializeField] RectTransform m_ContainerTime;
|
| | | [SerializeField] Text m_Overdue;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | int currentSelectId = 0;
|
| | |
|
| | | OSGiftModel giftModel { get { return ModelCenter.Instance.GetModel<OSGiftModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | for (int i = 0; i < m_CloseBtns.Length; i++)
|
| | | {
|
| | | m_CloseBtns[i].onClick.AddListener(OnCloseClick);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += windowAfterCloseEvent;
|
| | | model.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | giftModel.timeLimitUpdate += TimeLimitUpdate;
|
| | | giftModel.SetDayRemind();
|
| | | Display();
|
| | | if (!giftModel.alreadyOpens.Contains(giftModel.selectIndex))
|
| | | {
|
| | | giftModel.selectIndex = giftModel.alreadyOpens[0];
|
| | | }
|
| | |
|
| | | m_ContainerDisplay.gameObject.SetActive(!WindowCenter.Instance.IsOpen<OffLineOnHookWin>());
|
| | | model.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | giftModel.onSelectUpdate += OnSelectUpdate;
|
| | | giftModel.jumpGiftId = 0;
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterOpenEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= windowAfterCloseEvent;
|
| | | model.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | giftModel.timeLimitUpdate -= TimeLimitUpdate;
|
| | | giftModel.onSelectUpdate -= OnSelectUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void WindowAfterOpenEvent(Window _win)
|
| | | {
|
| | | if(_win is OffLineOnHookWin)
|
| | | {
|
| | | m_ContainerDisplay.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void windowAfterCloseEvent(Window _win)
|
| | | {
|
| | | if (_win is OffLineOnHookWin)
|
| | | {
|
| | | m_ContainerDisplay.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshBuyShopLimitEvent()
|
| | | private void OnSelectUpdate()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | | private void RefreshBuyShopLimitEvent()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
| | | DisplayTimer();
|
| | | }
|
| | |
|
| | | private void TimeLimitUpdate()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | void DisplayTimer()
|
| | | {
|
| | | var seconds = (int)(giftModel.overDueTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | if (giftModel.IsGiftOverdue(currentSelectId) || seconds <= 0)
|
| | | if (giftModel.selectIndex >= 0 && giftModel.selectIndex < giftModel.gifts.Count)
|
| | | {
|
| | | m_ContainerTime.gameObject.SetActive(false);
|
| | | m_Overdue.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerTime.gameObject.SetActive(true);
|
| | | m_Overdue.gameObject.SetActive(false);
|
| | | m_Timer.text = TimeUtility.SecondsToDHMSCHS(seconds);
|
| | | m_Timer.color = UIHelper.GetUIColor(TextColType.Green);
|
| | | var gift = giftModel.gifts[giftModel.selectIndex];
|
| | | var startTime = TimeUtility.GetTime(giftModel.startSeconds);
|
| | | var endTime = startTime.AddDays(gift.openDays);
|
| | | endTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 0, 0, 0);
|
| | | var seconds = (int)(endTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | if (seconds <= 0)
|
| | | {
|
| | | m_ContainerTime.gameObject.SetActive(false);
|
| | | m_Overdue.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerTime.gameObject.SetActive(true);
|
| | | m_Overdue.gameObject.SetActive(false);
|
| | | m_Timer.text = TimeUtility.SecondsToDHMSCHS(seconds);
|
| | | m_Timer.color = UIHelper.GetUIColor(TextColType.Green);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void Display()
|
| | | {
|
| | | List<StoreConfig> _list = null;
|
| | | StoreConfig.TryGetStoreConfigs((int)StoreFunc.OSGift, out _list);
|
| | | var _index = 0;
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | for (int i = 0; i < giftModel.gifts.Count; i++)
|
| | | {
|
| | | if (!giftModel.IsGiftOverdue(_list[i].ID))
|
| | | if (giftModel.selectIndex == i)
|
| | | {
|
| | | var _storeConfig = Config.Instance.Get<StoreConfig>(_list[i].ID);
|
| | | var _limit = model.GetBuyShopLimit((uint)_list[i].ID);
|
| | | if (_limit == null || _limit.BuyCnt < _storeConfig.PurchaseNumber[0])
|
| | | {
|
| | | _index = i;
|
| | | currentSelectId = _list[i].ID;
|
| | | m_OSGifts[i].Display(_list[i].ID);
|
| | | break;
|
| | | }
|
| | | m_OSGifts[i].Display(giftModel.gifts[i].giftId);
|
| | | _index = i;
|
| | | break;
|
| | | }
|
| | | _index = i;
|
| | | }
|
| | | giftModel.SetDayRemind(giftModel.selectIndex);
|
| | | for (int i = 0; i < m_OSGifts.Length; i++)
|
| | | {
|
| | | m_OSGifts[i].gameObject.SetActive(_index == i);
|
| | | }
|
| | | DisplayTimer();
|
| | | }
|
| | |
|
| | | private void OnCloseClick()
|
| | | {
|
| | | CloseImmediately();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | bestIconObj.SetActive(false);
|
| | | bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | |
| | | var info = items[i];
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(info.itemId);
|
| | | poolItem.nameText.text = itemConfig.ItemName;
|
| | | poolItem.nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | poolItem.nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor,true);
|
| | | ItemCellModel cellModel = new ItemCellModel(info.itemId,true,(ulong)info.itemCount,info.isBind);
|
| | | poolItem.itemBaisc.Init(cellModel);
|
| | | if(i == 0)
|
| | |
| | | [SerializeField] GameObject noneItemObj;
|
| | | [SerializeField] Button noneItemBtn;
|
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] GameObject bestIconObj;
|
| | |
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | |
| | | {
|
| | | WishingPoolModel.WishingWellItem wellItem = null;
|
| | | bool isWishData = wishingModel.TryGetWishDataByIndex(index, out wellItem);
|
| | | noneItemBtn.RemoveAllListeners();
|
| | | if (isWishData)
|
| | | {
|
| | | nameText.gameObject.SetActive(true);
|
| | | itemBaisc.gameObject.SetActive(true);
|
| | | noneItemObj.gameObject.SetActive(false);
|
| | | bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(wellItem.itemId);
|
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | |
| | | itemBaisc.gameObject.SetActive(false);
|
| | | noneItemObj.gameObject.SetActive(true);
|
| | | nameText.gameObject.SetActive(false);
|
| | | bestIconObj.SetActive(false);
|
| | | noneItemBtn.AddListener(()=>
|
| | | {
|
| | | wishingModel.SetHandMovePos(index);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class WishingGetItemWin : Window
|
| | | {
|
| | | [SerializeField] Button sureBtn;
|
| | | [SerializeField] List<AwardItem> awardItems = new List<AwardItem>();
|
| | |
|
| | | WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | | sureBtn.AddListener(ClickRecevie);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | SetDisplayModel();
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | transform.SetAsLastSibling();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | private void SetDisplayModel()
|
| | | {
|
| | | List<WishingPoolModel.WishingWellItem> wellItems = wishModel.wishingAwardDict.Values.ToList();
|
| | | for (int i = 0; i < awardItems.Count; i++)
|
| | | {
|
| | | var awardItem = awardItems[i];
|
| | | if (i < wellItems.Count)
|
| | | {
|
| | | awardItem.parentObj.SetActive(true);
|
| | | var wellItem = wellItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel((int)wellItem.itemId, true
|
| | | , (ulong)wellItem.itemCount, wellItem.isBind);
|
| | | awardItem.itemBaisc.Init(cellModel);
|
| | | awardItem.bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | awardItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | awardItem.itemBaisc.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData((int)wellItem.itemId, true
|
| | | , (ulong)wellItem.itemCount, -1,wellItem.isBind);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | awardItem.parentObj.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickRecevie()
|
| | | {
|
| | | wishModel.SendGetAwardQuest();
|
| | | CloseClick();
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class AwardItem
|
| | | {
|
| | | public GameObject parentObj;
|
| | | public CommonItemBaisc itemBaisc;
|
| | | public GameObject bestIconObj;
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a946e5a3486ff5f4b88beb7fc4284d30 |
| | | timeCreated: 1540352052 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | {
|
| | | public event Action<int> UpdateWishingDataEvent;
|
| | | public event Action<int> UpdatePoolDataEvent;
|
| | | public event Action UpdateWishAwardEvent;
|
| | | public event Action<int> onStateUpate;
|
| | | public const int WishRedKey = 20915;
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy, this);
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.WishingPool, this);
|
| | | SetWishRedpoint();
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | public bool TryGetFreeWishCoolTime(out int second)
|
| | | {
|
| | | second = 0;
|
| | | if (freeStartTime == 25) return false;
|
| | |
|
| | | int endhour = freeStartTime + 2;
|
| | | int nowHour = TimeUtility.ServerNow.Hour;
|
| | | second = (endhour - nowHour) * 3600;
|
| | | int endSeconds = freeStartTime + freeRefreshCoolTime;
|
| | | DateTime endTime = TimeUtility.GetTime((uint)endSeconds);
|
| | | second = Mathf.CeilToInt((float)(endTime - TimeUtility.ServerNow).TotalSeconds);
|
| | | if(second > 0)
|
| | | {
|
| | | return true;
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsBestItem()
|
| | | {
|
| | | foreach(var key in poolDataDict.Keys)
|
| | | {
|
| | | if(poolDataDict[key].isBest == 1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int handStartIndex { get; private set; }
|
| | | public int handEndIndex { get; private set;}
|
| | | public event Action UpdateHandMoveEvent;
|
| | | public void SetHandMovePos(int wishIndex)
|
| | | {
|
| | | foreach(var key in poolDataDict.Keys)
|
| | | {
|
| | | if(poolDataDict[key].itemId != 0)
|
| | | {
|
| | | handStartIndex = key;
|
| | | break;
|
| | | }
|
| | | }
|
| | | handEndIndex = wishIndex;
|
| | | if(UpdateHandMoveEvent != null)
|
| | | {
|
| | | UpdateHandMoveEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | #region 本地数据
|
| | | public bool isDraging { get; set; }
|
| | |
| | | isDraging = false;
|
| | | dragIndex = -1;
|
| | | }
|
| | | public int freeRefreshCoolTime { get; private set;}
|
| | | public string wishingPriceFormula { get; private set;}
|
| | | public void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("WishingWellCfg");
|
| | | freeRefreshCoolTime = int.Parse(funcConfig.Numerical1);
|
| | | wishingPriceFormula = funcConfig.Numerical2;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 协议
|
| | | Dictionary<int, WishingWellItem> poolDataDict = new Dictionary<int, WishingWellItem>();
|
| | | public int freeStartTime { get; private set; }// 免费开始倒计时时间
|
| | | public int alreadyWishNum { get; private set; } // 许愿付费刷新次数
|
| | |
|
| | | public int wishingPrice { get; private set;}
|
| | | public void SetWishingWellPlayerInfo(HAA1A_tagMCActWishingWellPlayerInfo wishInfo)
|
| | | {
|
| | | freeStartTime = (int)wishInfo.FreeStartTime;
|
| | | alreadyWishNum = (int)wishInfo.WishCnt;
|
| | | wishingPrice = GetWishingPrice((int)wishInfo.WishCnt);
|
| | | for(int i = 0; i < wishInfo.WellItemCnt; i++)
|
| | | {
|
| | | var itemInfo = wishInfo.WellItemInfo[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind);
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID,itemInfo.ItemCnt,itemInfo.IsBind,itemInfo.IsSpecial);
|
| | | SetWishingPoolData(i,wellItem);
|
| | | }
|
| | |
|
| | | for(int i = 0; i < wishInfo.CurAwardCnt; i++)
|
| | | {
|
| | | var itemInfo = wishInfo.CurAwardItemInfo[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind);
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
|
| | | SetWishingData(i, wellItem);
|
| | | }
|
| | |
|
| | |
| | | for (int i = 0; i < wishInfo.LastAwardCnt; i++)
|
| | | {
|
| | | var itemInfo = wishInfo.LastAwardItemInfo[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind);
|
| | | SetWishingAwardData(i, wellItem);
|
| | | if(itemInfo.ItemID != 0)
|
| | | {
|
| | | WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
|
| | | SetWishingAwardData(i, wellItem);
|
| | | }
|
| | | }
|
| | | UpdateRedpoint();
|
| | | if(UpdateWishAwardEvent != null)
|
| | | {
|
| | | UpdateWishAwardEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetWishingPrice(int wishNum)
|
| | | {
|
| | | Equation.Instance.Clear();
|
| | | Equation.Instance.AddKeyValue("refreshCnt",wishNum);
|
| | | return Equation.Instance.Eval<int>(wishingPriceFormula);
|
| | | }
|
| | |
|
| | | public void SetWishingResultInfo(HAA1B_tagMCActWishingDragResult result)
|
| | | {
|
| | | for(int i = 0; i < result.Cnt;i++)
|
| | | {
|
| | | var resultInfo = result.InfoList[i];
|
| | | WishingWellItem wellItem = new WishingWellItem((int)resultInfo.ItemID, resultInfo.ItemCnt, resultInfo.IsBind, resultInfo.IsSpecial);
|
| | | switch (resultInfo.WellType)
|
| | | {
|
| | | case 0:
|
| | | SetWishingPoolData(resultInfo.Index, wellItem);
|
| | | break;
|
| | | case 1:
|
| | | SetWishingData(resultInfo.Index, wellItem);
|
| | | break;
|
| | | }
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, WishingWellItem> wishingAwardDict = new Dictionary<int, WishingWellItem>();
|
| | | public Dictionary<int, WishingWellItem> wishingAwardDict = new Dictionary<int, WishingWellItem>();
|
| | | public void SetWishingAwardData(int index, WishingWellItem wellItem)
|
| | | {
|
| | | if (!wishingAwardDict.ContainsKey(index))
|
| | |
| | | GameNetSystem.Instance.SendInfo(wishingRefresh);
|
| | | }
|
| | |
|
| | | public void SendGetAwardQuest()
|
| | | {
|
| | | CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
|
| | | getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_WishingWell;
|
| | | getReward.DataEx = 0;
|
| | | getReward.DataExStrLen = 0;
|
| | | getReward.DataExStr = string.Empty;
|
| | | GameNetSystem.Instance.SendInfo(getReward);
|
| | | }
|
| | |
|
| | | public void SendRefreshWishInfo(int poolIndex,int wishIndex)
|
| | | {
|
| | | CAA06_tagCMActWishing actWishing = new CAA06_tagCMActWishing();
|
| | |
| | | }
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | int second = 0;
|
| | | bool isCool = TryGetFreeWishCoolTime(out second);
|
| | | if(IsOpen && !isCool)
|
| | | {
|
| | | freeWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | freeWishRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | freeWishRedpoint.state = RedPointState.None;
|
| | | for (int i = 0; i < wishPointlist.Count; i++)
|
| | | {
|
| | | var wishPoint = wishPointlist[i];
|
| | | wishPoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | if (!IsOpen) return;
|
| | |
|
| | | int second = 0;
|
| | | bool isCool = TryGetFreeWishCoolTime(out second);
|
| | | if(!isCool)
|
| | | {
|
| | | freeWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < wishPointlist.Count; i++)
|
| | |
| | |
|
| | | public void ResetPoolData()
|
| | | {
|
| | | freeStartTime = 25;
|
| | | freeStartTime = 0;
|
| | | poolDataDict.Clear();
|
| | | wishingDataDict.Clear();
|
| | | wishingAwardDict.Clear();
|
| | |
| | | public int itemId;
|
| | | public int itemCount;
|
| | | public int isBind;
|
| | | public WishingWellItem(int id,int count,int isBind)
|
| | | public int isBest;
|
| | | public WishingWellItem(int id,int count,int isBind,int isBest)
|
| | | {
|
| | | this.itemId = id;
|
| | | this.itemCount = count;
|
| | | this.isBind = isBind;
|
| | | this.isBest = isBest;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine.UI;
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using DG.Tweening;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | [SerializeField] List<WishItemCell> wishingCells = new List<WishItemCell>();
|
| | | [SerializeField] GameObject activityOpenObj;
|
| | | [SerializeField] GameObject activityCloseObj;
|
| | | [Header("动画控制")]
|
| | | [SerializeField] RectTransform handImg;
|
| | | [SerializeField] PositionTween positionTween;
|
| | | [SerializeField] UIAlphaTween alphaTween;
|
| | | [SerializeField] List<Vector2> startPos = new List<Vector2>();
|
| | | [SerializeField] List<Vector2> endPos = new List<Vector2>();
|
| | |
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
|
| | |
| | | wishingModel.UpdatePoolDataEvent += UpdatePoolItemByIndex;
|
| | | wishingModel.UpdateWishingDataEvent += UpdateWishItemByIndex;
|
| | | GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
|
| | | wishingModel.UpdateHandMoveEvent += UpdateHandMove;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | wishingModel.UpdateWishingDataEvent -= UpdateWishItemByIndex;
|
| | | GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | wishingModel.UpdateHandMoveEvent -= UpdateHandMove;
|
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
| | | UpdateFreeWishCool();
|
| | | UpdateActivityState();
|
| | | UpdateDayRemainTime();
|
| | | activityDayText.text = Language.Get("WishingPool103", Language.Get(StringUtility.Contact("Num_CHS_", operation.GetActivityDay())));
|
| | | activityDayText.text = Language.Get("WishingPool103", operation.GetActivityDay());
|
| | | totalDayText.text = Language.Get("WishingPool101", Language.Get(StringUtility.Contact("Num_CHS_", operation.totalDays + 1)));
|
| | | handImg.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | private void UpdateHandMove()
|
| | | {
|
| | | PlayHandMovePos();
|
| | | }
|
| | |
|
| | | private void PlayHandMovePos()
|
| | | {
|
| | | positionTween.from = startPos[wishingModel.handStartIndex];
|
| | | positionTween.to = endPos[wishingModel.handEndIndex];
|
| | | positionTween.SetStartState();
|
| | | alphaTween.from = 0;
|
| | | alphaTween.to = 1;
|
| | | alphaTween.SetStartState();
|
| | | handImg.gameObject.SetActive(true);
|
| | | int offset = wishingModel.handStartIndex % 4 - wishingModel.handEndIndex;
|
| | | positionTween.duration = Mathf.Max(2, Mathf.Abs(offset));
|
| | | alphaTween.Play();
|
| | | positionTween.Play(() =>
|
| | | {
|
| | | handImg.gameObject.SetActive(false);
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | | #region 许愿逻辑
|
| | |
| | |
|
| | | private void CheckWishingCell()
|
| | | {
|
| | | bool isAddWish = false;
|
| | | for(int i = 0; i < wishingCells.Count; i++)
|
| | | {
|
| | | var rect = wishingCells[i].transform as RectTransform;
|
| | |
| | | // wishingModel.SetWishingPoolData(wishingModel.dragIndex,wellWishItem);
|
| | | //}
|
| | | //wishingModel.SetWishingData(i,wellPoolItem);
|
| | | isAddWish = true;
|
| | | wishingModel.SendRefreshWishInfo(wishingModel.dragIndex,i);
|
| | | break;
|
| | | }
|
| | | }
|
| | | if(!isAddWish)
|
| | | {
|
| | | UpdatePoolItem();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (isPoolData)
|
| | | {
|
| | | dragItem.dragItemRect.gameObject.SetActive(true);
|
| | | dragItem.dragBestIcon.SetActive(false);
|
| | | dragItem.dragBestIcon.SetActive(wellItem.isBest == 0 ? false : true);
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
|
| | | dragItem.dragItemBasic.Init(cellModel);
|
| | | poolItemCells[wishingModel.dragIndex].gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | freeRefreshWishBtn.gameObject.SetActive(false);
|
| | | freeWishCoolText.gameObject.SetActive(true);
|
| | | moneyRefreshWishBtn.gameObject.SetActive(true);
|
| | | moneyValueText.text = "100";
|
| | | moneyValueText.text = wishingModel.wishingPrice.ToString();
|
| | | freeWishCoolText.text = Language.Get("WishingPool102", TimeUtility.SecondsToHMS(second));
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | private void ClickMoneyRefreshWish()
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(0);
|
| | | if(!wishingModel.IsBestItem())
|
| | | {
|
| | | CheckMoney();
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WishingPool106", wishingModel.wishingPrice), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | CheckMoney();
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckMoney()
|
| | | {
|
| | | if ((int)UIHelper.GetMoneyCnt(1) < wishingModel.wishingPrice)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WishingPool105", wishingModel.wishingPrice), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(0);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickFreeRefreshWish()
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(1);
|
| | | if (!wishingModel.IsBestItem())
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(1);
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WishingPool106", wishingModel.wishingPrice), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | wishingModel.SendRefreshPoolInfo(1);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | public static int godWeaponType { get; private set; }
|
| | | public static int treasureSoulId { get; private set; }
|
| | |
|
| | | private static Dictionary<int, int> propertyUpDict = new Dictionary<int, int>();
|
| | | private static Dictionary<int, int> lastPropertyDict = new Dictionary<int, int>();
|
| | | private static Dictionary<int, int> currentPropertyDict = new Dictionary<int, int>();
|
| | |
|
| | | public static event Action<ActivateFunc, int> prepareFlySkillEvent;
|
| | | public static event Action<ActivateFunc> complelteFlySkillEvent;
|
| | |
| | | {
|
| | | activateType = ActivateFunc.Realm;
|
| | | propertyCompares.Clear();
|
| | | propertyUpDict.Clear();
|
| | | currentPropertyDict.Clear();
|
| | | lastPropertyDict.Clear();
|
| | | beforeLv = _lv - 1;
|
| | | currentLv = _lv;
|
| | | var _beforeConfig = Config.Instance.Get<RealmConfig>(_lv - 1);
|
| | |
| | | if (_beforeConfig != null)
|
| | | {
|
| | | _beforeProperties.AddRange(_beforeConfig.AddAttrType);
|
| | | for (int i = 0; i < _beforeConfig.AddAttrType.Length; i++)
|
| | | {
|
| | | lastPropertyDict.Add(_beforeConfig.AddAttrType[i], _beforeConfig.AddAttrNum[i]);
|
| | | }
|
| | | }
|
| | | var config = Config.Instance.Get<RealmConfig>(_lv);
|
| | | for (int i = 0; i < config.AddAttrType.Length; i++)
|
| | |
| | | var _index = _beforeProperties.IndexOf(config.AddAttrType[i]);
|
| | | if (_index == -1 || config.AddAttrNum[i] > _beforeConfig.AddAttrNum[_index])
|
| | | {
|
| | | propertyUpDict.Add(config.AddAttrType[i], config.AddAttrNum[i] -
|
| | | (_index == -1 ? 0 : _beforeConfig.AddAttrNum[_index]));
|
| | | propertyCompares.Add(new PropertyCompare()
|
| | | {
|
| | | key = config.AddAttrType[i],
|
| | |
| | | currentValue = config.AddAttrNum[i]
|
| | | });
|
| | | }
|
| | |
|
| | | currentPropertyDict.Add(config.AddAttrType[i], config.AddAttrNum[i]);
|
| | | }
|
| | | fightPower = UIHelper.GetFightPower(propertyUpDict);
|
| | | fightPower = UIHelper.GetFightPower(currentPropertyDict) - UIHelper.GetFightPower(lastPropertyDict);
|
| | | titleIconKey = "UI_JH_3";
|
| | |
|
| | | if (!WindowCenter.Instance.IsOpen<RealmPropertyUpWin>())
|
| | |
| | | beforeLv = _beforeLv;
|
| | | skills.Clear();
|
| | | propertyCompares.Clear();
|
| | | propertyUpDict.Clear();
|
| | | lastPropertyDict.Clear();
|
| | | currentPropertyDict.Clear();
|
| | |
|
| | | var _model = ModelCenter.Instance.GetModel<MagicianModel>();
|
| | | if (_model.godWeaponSkillDict.ContainsKey(_type))
|
| | |
| | | if (_beforeConfig != null)
|
| | | {
|
| | | _beforeProperties.AddRange(_beforeConfig.AttrType);
|
| | | for (int i = 0; i < _beforeConfig.AttrType.Length; i++)
|
| | | {
|
| | | lastPropertyDict.Add(_beforeConfig.AttrType[i], _beforeConfig.AttrNum[i]);
|
| | | }
|
| | | }
|
| | | var config = GodWeaponConfig.GetGodWeaponCfgByTypeLv(_type, currentLv);
|
| | | for (int i = 0; i < config.AttrType.Length; i++)
|
| | |
| | | var _index = _beforeProperties.IndexOf(config.AttrType[i]);
|
| | | if (_index == -1 || config.AttrNum[i] > _beforeConfig.AttrNum[_index])
|
| | | {
|
| | | propertyUpDict.Add(config.AttrType[i], config.AttrNum[i] -
|
| | | (_index == -1 ? 0 : _beforeConfig.AttrNum[_index]));
|
| | | propertyCompares.Add(new PropertyCompare()
|
| | | {
|
| | | key = config.AttrType[i],
|
| | |
| | | currentValue = config.AttrNum[i]
|
| | | });
|
| | | }
|
| | |
|
| | | currentPropertyDict.Add(config.AttrType[i], config.AttrNum[i]);
|
| | | }
|
| | |
|
| | | fightPower = UIHelper.GetFightPower(propertyUpDict);
|
| | | fightPower = UIHelper.GetFightPower(currentPropertyDict) - UIHelper.GetFightPower(lastPropertyDict);
|
| | | if (_beforeLv != 0)
|
| | | {
|
| | | for (int i = 0; i < skills.Count; i++)
|
| | |
| | | {
|
| | | activateType = ActivateFunc.Stove;
|
| | | propertyCompares.Clear();
|
| | | propertyUpDict.Clear();
|
| | | currentPropertyDict.Clear();
|
| | | lastPropertyDict.Clear();
|
| | | skills.Clear();
|
| | | beforeLv = stoveLv - 1;
|
| | | currentLv = stoveLv;
|
| | |
| | | if (_beforeConfig != null)
|
| | | {
|
| | | _beforeProperties.AddRange(_beforeConfig.AttrID);
|
| | | for (int i = 0; i < _beforeConfig.AttrID.Length; i++)
|
| | | {
|
| | | lastPropertyDict.Add(_beforeConfig.AttrID[i], _beforeConfig.AttrValue[i]);
|
| | | }
|
| | | }
|
| | | var config = Config.Instance.Get<RefineStoveConfig>(stoveLv);
|
| | | for (int i = 0; i < config.AttrID.Length; i++)
|
| | |
| | | var _index = _beforeProperties.IndexOf(config.AttrID[i]);
|
| | | if (_index == -1 || config.AttrValue[i] > _beforeConfig.AttrValue[_index])
|
| | | {
|
| | | propertyUpDict.Add(config.AttrID[i], config.AttrValue[i] -
|
| | | (_index == -1 ? 0 : _beforeConfig.AttrValue[_index]));
|
| | | propertyCompares.Add(new PropertyCompare()
|
| | | {
|
| | | key = config.AttrID[i],
|
| | |
| | | currentValue = config.AttrValue[i]
|
| | | });
|
| | | }
|
| | |
|
| | | currentPropertyDict.Add(config.AttrID[i], config.AttrValue[i]);
|
| | | }
|
| | | fightPower = UIHelper.GetFightPower(propertyUpDict);
|
| | | fightPower = UIHelper.GetFightPower(currentPropertyDict) - UIHelper.GetFightPower(lastPropertyDict);
|
| | | titleIconKey = "XT_LD_01";
|
| | |
|
| | | if (!WindowCenter.Instance.IsOpen<StoveUpgradWin>())
|
| | |
| | | treasureSoulId = id;
|
| | | titleIconKey = "XT_FBZH_11";
|
| | | propertyCompares.Clear();
|
| | | propertyUpDict.Clear();
|
| | | lastPropertyDict.Clear();
|
| | | currentPropertyDict.Clear();
|
| | | var model = ModelCenter.Instance.GetModel<TreasureSoulModel>();
|
| | | TreasureSpecialData special;
|
| | | if (model.TryGetTreasureSoul(treasureSoulId, out special))
|
| | |
| | | if (_beforeConfig != null)
|
| | | {
|
| | | _beforeProperties.AddRange(_beforeConfig.attType);
|
| | | for (int i = 0; i < _beforeConfig.attType.Length; i++)
|
| | | {
|
| | | lastPropertyDict.Add(_beforeConfig.attType[i], _beforeConfig.attValue[i]);
|
| | | }
|
| | | }
|
| | | var config = (present < 0 || present >= configs.Count) ? null : configs[present];
|
| | | if (config == null)
|
| | |
| | | var _index = _beforeProperties.IndexOf(config.attType[i]);
|
| | | if (_index == -1 || config.attValue[i] > _beforeConfig.attValue[_index])
|
| | | {
|
| | | propertyUpDict.Add(config.attType[i], config.attValue[i] -
|
| | | (_index == -1 ? 0 : _beforeConfig.attValue[_index]));
|
| | | propertyCompares.Add(new PropertyCompare()
|
| | | {
|
| | | key = config.attType[i],
|
| | |
| | | currentValue = config.attValue[i]
|
| | | });
|
| | | }
|
| | |
|
| | | currentPropertyDict.Add(config.attType[i], config.attValue[i]);
|
| | | }
|
| | | break;
|
| | | case TreasurePrivilege.DemonJarAtk:
|
| | |
| | | {
|
| | | var beforeValue = special.propertyDict[_key] * _beforeLevel / special.progress;
|
| | | var nowValue = special.propertyDict[_key] * _currentLevel / special.progress;
|
| | | propertyUpDict.Add(_key, nowValue - beforeValue);
|
| | | lastPropertyDict.Add(_key, beforeValue);
|
| | | currentPropertyDict.Add(_key, nowValue);
|
| | | propertyCompares.Add(new PropertyCompare()
|
| | | {
|
| | | key = _key,
|
| | |
| | | }
|
| | | break;
|
| | | }
|
| | | fightPower = UIHelper.GetFightPower(propertyUpDict);
|
| | | fightPower = UIHelper.GetFightPower(currentPropertyDict) - UIHelper.GetFightPower(lastPropertyDict);
|
| | | if (!WindowCenter.Instance.IsOpen<RealmPropertyUpWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<RealmPropertyUpWin>();
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | if (requireProperty != 0)
|
| | | {
|
| | | var requirePropertyValue = skillConfig.RequirePropertyValue();
|
| | | if (UIHelper.GetPropertyMapPlayerData((AttrEnum)requireProperty) < requirePropertyValue)
|
| | | {
|
| | | error = 5;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | break;
|
| | | case 4:
|
| | | SysNotifyMgr.Instance.ShowTip("PreTalentLevelLimit");
|
| | | break;
|
| | | case 5:
|
| | | SysNotifyMgr.Instance.ShowTip("TalentRequirePropertyLimit");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | return config.LearnSkillPointReq % 10000;
|
| | | }
|
| | |
|
| | | public static int RequireProperty(this SkillConfig config)
|
| | | {
|
| | | if (config == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | return config.StateSkillLV / 10000;
|
| | | }
|
| | |
|
| | | public static int RequirePropertyValue(this SkillConfig config)
|
| | | {
|
| | | if (config == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | return config.StateSkillLV % 10000;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | |
| | | model.selectSkillEvent += OnSelectSkillEvent;
|
| | | model.talentSkillUpdate += TalentSkillUpdate;
|
| | | model.talentPointUpdate += TalentPointUpdate;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | model.selectSkillEvent -= OnSelectSkillEvent;
|
| | | model.talentSkillUpdate -= TalentSkillUpdate;
|
| | | model.talentPointUpdate -= TalentPointUpdate;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | for (int i = 0; i < m_TalentSeries.Length; i++)
|
| | | {
|
| | | m_TalentSeries[i].Dispose();
|
| | |
| | | DisplaySkillEffect();
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | switch (refreshType)
|
| | | {
|
| | | case PlayerDataRefresh.STR:
|
| | | case PlayerDataRefresh.PNE:
|
| | | case PlayerDataRefresh.PHY:
|
| | | case PlayerDataRefresh.CON:
|
| | | DisplayConditions();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayConditions()
|
| | | {
|
| | | TalentSkill talent;
|
| | |
| | | m_SelectConditions[index].text = StringUtility.Contact(seriesDisplay, requireDisplay);
|
| | | index++;
|
| | | }
|
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | if (requireProperty != 0 && index < m_SelectConditions.Length)
|
| | | {
|
| | | m_SelectConditions[index].gameObject.SetActive(true);
|
| | | var requirePropertyValue = skillConfig.RequirePropertyValue();
|
| | | var propertyValue = UIHelper.GetPropertyMapPlayerData((AttrEnum)requireProperty);
|
| | | var requireDisplay = StringUtility.Contact(propertyValue, "/", requirePropertyValue);
|
| | | requireDisplay = UIHelper.GetTextColorByItemColor(propertyValue >= requirePropertyValue ?
|
| | | TextColType.Green : TextColType.Red, requireDisplay);
|
| | | var propertyConfig = Config.Instance.Get<PlayerPropertyConfig>(requireProperty);
|
| | | var propertyDisplay = Language.Get("TalentPropertyCondition", propertyConfig.Name);
|
| | | m_SelectConditions[index].text = StringUtility.Contact(propertyDisplay, requireDisplay);
|
| | | index++;
|
| | | }
|
| | | }
|
| | | if (skillConfig != null && index < m_SelectConditions.Length)
|
| | | {
|
| | |
| | | |
| | | public void PlayLoginMusic()
|
| | | {
|
| | | var loginMusic = Resources.Load<AudioClip>("Music/Music_Login");
|
| | | var loginMusic = BuiltInLoader.LoadMusic("Music_Login");
|
| | | if (!m_MusicAudioSource.isPlaying || m_MusicAudioSource.clip != loginMusic)
|
| | | {
|
| | | StartCoroutine(Co_BackGroundMusicFadeOutIn(loginMusic, false));
|
| | |
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] RichText m_Goto;
|
| | | [SerializeField] Text fightPower;
|
| | | [SerializeField] Text qualityText;
|
| | | [SerializeField] Image desImg;
|
| | |
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | |
| | | rawImag.gameObject.SetActive(true);
|
| | | if(itemConfig != null)
|
| | | {
|
| | | titleText.text = itemConfig.ItemName;
|
| | | titleText.color = UIHelper.GetUIColor(itemConfig.ItemColor,true);
|
| | | switch (itemConfig.Type)
|
| | | {
|
| | | case 26:
|
| | | titleText.text = Language.Get("StorePetPush");
|
| | | PetInfoConfig petInfo = tipsModel.unlockPetDict[storeConfig.ItemID];
|
| | | var config = Config.Instance.Get<NPCConfig>(petInfo.ID);
|
| | | fightPower.text = petInfo.ShowFightPower.ToString();
|
| | | qualityText.text = tipsModel.GetQualityName(petInfo.Quality);
|
| | | desImg.SetSprite(petInfo.DescribeIconKey);
|
| | | desImg.SetNativeSize();
|
| | | UI3DModelExhibition.Instance.ShowNPC(petInfo.ID, config.UIModeLOffset, config.UIModelRotation,rawImag);
|
| | | break;
|
| | | case 41:
|
| | | titleText.text = Language.Get("StoreMountPush");
|
| | | HorseConfig horseConfig = tipsModel.unlockMountDict[storeConfig.ItemID];
|
| | | fightPower.text = horseConfig.ShowFightPower.ToString();
|
| | | qualityText.text = tipsModel.GetQualityName(horseConfig.Quality);
|
| | | desImg.SetSprite(horseConfig.DescribeIconKey);
|
| | | desImg.SetNativeSize();
|
| | | UI3DModelExhibition.Instance.ShowHourse(horseConfig.Model,rawImag);
|
| | | break;
|
| | | }
|
| | |
| | | CheckTypeBtnRedPointCondition();
|
| | | }
|
| | |
|
| | | #region 处理跳转数据
|
| | | public void SetJumpModel(int suitType)
|
| | | {
|
| | | EquipSuitTips.E_SuitType = (SuitType)suitType;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void RefreshFuncOpenState(int funcId)
|
| | | {
|
| | | if (funcId != (int)FuncOpenEnum.Suit)
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | |
|
| | | #region 成就前往数据
|
| | | public SuitType jumpToSuitType { get; private set;}
|
| | | public int jumpToGroupType { get; private set; } //1.防具 2.仙器
|
| | | public int jumpToEquipPlace { get; private set; }
|
| | |
| | | jumpToGroupType = 0;
|
| | | jumpToEquipPlace = 0;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public int GetMakerEquipPlace()
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | E_SuitType = SuitType.LowSuit;
|
| | | bool isSwitch = true;
|
| | | foreach(var red in SuitModel.suitCellRedPointDict.Values)
|
| | | if(!WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | if(red.state == RedPointState.Simple)
|
| | | E_SuitType = SuitType.LowSuit;
|
| | | bool isSwitch = true;
|
| | | foreach (var red in SuitModel.suitCellRedPointDict.Values)
|
| | | {
|
| | | isSwitch = false;
|
| | | break;
|
| | | if (red.state == RedPointState.Simple)
|
| | | {
|
| | | isSwitch = false;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (SuitModel.typeBtnRedPoint.state == RedPointState.Simple && isSwitch)
|
| | | {
|
| | | E_SuitType = SuitType.HighSuit;
|
| | | if (SuitModel.typeBtnRedPoint.state == RedPointState.Simple && isSwitch)
|
| | | {
|
| | | E_SuitType = SuitType.HighSuit;
|
| | | }
|
| | | }
|
| | | }
|
| | | equipPartlist = SuitModel.GetEquipOrderlist(E_SuitType);
|
| | |
| | |
|
| | |
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
|
| | | var WingItem = Config.Instance.Get<WingRefineExpConfig>(itemModel.itemId);
|
| | | if (itemModel == null || WingItem == null)
|
| | | if (itemModel == null)
|
| | | {
|
| | | return;
|
| | |
|
| | | }
|
| | | var WingItem = Config.Instance.Get<WingRefineExpConfig>(itemModel.itemId);
|
| | | if (WingItem == null)
|
| | | {
|
| | | return;
|
| | | } |
| | | int YRefiningRatioMin = 0;//预览生命比值
|
| | | int YRefiningRatioMax = 0;//预览生命比值
|
| | | float _RefiningDegreesMin = 0;
|
| | |
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.coins, true);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.other, true);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.isAutoDrop, true);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.isAutoHangUp,false);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.isAutoHangUp,true);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.isAutoBuyDrug, true);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.isAutoSell, true);
|
| | | HangUpSetModel.Instance.SetBoolSetStr(HangUpAutoBoolType.isAutoDevour, true);
|
| | |
| | | case PlayerDetails.OpenType.Default: |
| | | if (PlayerDatas.Instance.fairyData.HasFairy) |
| | | { |
| | | if (PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanKick) && |
| | | if (PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanCall) && |
| | | PlayerDatas.Instance.fairyData.GetMember(PlayerDetails.PlayerID) == null) |
| | | { |
| | | funcTypes.Add(PlayerDetails.DetailType.InviteFairy); |
| | |
| | | && _mine.FamilyLV > _fairyMember.FamilyLV) |
| | | { |
| | | funcTypes.Add(PlayerDetails.DetailType.FairyLv); |
| | | } |
| | | if (PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanKick)
|
| | | && _mine.FamilyLV > _fairyMember.FamilyLV)
|
| | | {
|
| | | funcTypes.Add(PlayerDetails.DetailType.KickFairy); |
| | | } |
| | | } |
| | |
| | | const string HUMAN_LOCKSFX_STATE_2 = "Effcet_FaBao_FengYin_02";
|
| | | const string DEMON_LOCKSFX_STATE_1 = "Effcet_FaBao_FengYin2_01";
|
| | | const string DEMON_LOCKSFX_STATE_2 = "Effcet_FaBao_FengYin2_02";
|
| | | const string HUMAN_HIGHEST_STAGE_1 = "Effect_FaBao_QuanJueXing";
|
| | | const string HUMAN_HIGHEST_STAGE_2 = "Effect_FaBao_QuanJueXing_2";
|
| | | const int HUMAN_BACKLIGHT_EFFECT = 5115;
|
| | | const int DEMON_BACKLIGHT_EFFECT = 5116;
|
| | | const int FAIRY_BACKLIGHT_EFFECT = 5117;
|
| | |
| | | public void RequestHighestEffect()
|
| | | {
|
| | | RecycleHighestEffect();
|
| | | //Treasure _treasure;
|
| | | //if (category == TreasureCategory.Human &&
|
| | | // model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | // && !model.GetTreasureFinishAnim(treasureId))
|
| | | //{
|
| | | // highestSfx = SFXPlayUtility.Instance.Play(5198, root);
|
| | | // if (highestSfx != null)
|
| | | // {
|
| | | // highestSfx.duration = 0;
|
| | | // LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | // highestSfx.transform.localPosition = Vector3.zero;
|
| | | // highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | // }
|
| | | //}
|
| | | Treasure _treasure;
|
| | | if (category == TreasureCategory.Human &&
|
| | | model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | && !model.GetTreasureFinishAnim(treasureId))
|
| | | {
|
| | | highestSfx = SFXPlayUtility.Instance.Play(5197, root);
|
| | | if (highestSfx != null)
|
| | | {
|
| | | var animator = highestSfx.GetComponentInChildren<Animator>(true);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(HUMAN_HIGHEST_STAGE_1, 0, 0);
|
| | | }
|
| | | highestSfx.duration = 0;
|
| | | LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | highestSfx.transform.localPosition = Vector3.zero;
|
| | | highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void RecycleHighestEffect()
|
| | |
| | | var _effect = SFXPlayUtility.Instance.Play(5197, root);
|
| | | if (_effect != null)
|
| | | {
|
| | | var animator = _effect.GetComponentInChildren<Animator>(true);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(HUMAN_HIGHEST_STAGE_2, 0, 0);
|
| | | }
|
| | | LayerUtility.SetLayer(_effect.gameObject, LayerUtility.UILayer, true);
|
| | | _effect.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | _effect.transform.localPosition = Vector3.zero;
|
| | |
| | |
|
| | | public bool GetTreasureFinishAnim(int _treasureId)
|
| | | {
|
| | | //if (_treasureId == 101)
|
| | | //{
|
| | | if (_treasureId == 101)
|
| | | {
|
| | | return false;
|
| | | //}
|
| | | //var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | //var index = list.IndexOf(_treasureId);
|
| | | //if (index == -1)
|
| | | //{
|
| | | // return false;
|
| | | //}
|
| | | //uint value = 0;
|
| | | //uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | //return MathUtility.GetBitValue(value, (ushort)index);
|
| | | }
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | return MathUtility.GetBitValue(value, (ushort)index);
|
| | | }
|
| | |
|
| | | public void SetTreasureFinishAnim(int _treasureId, bool anim = true)
|
| | | {
|
| | | //var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | //var index = list.IndexOf(_treasureId);
|
| | | //if (index == -1)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //uint value = 0;
|
| | | //uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | //int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | //QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | //QuickSetting.Instance.SendPackage();
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | QuickSetting.Instance.SendPackage();
|
| | | }
|
| | |
|
| | | public bool TryGetUnlockShowTreasure(out int _id)
|
| | |
| | | [SerializeField] ScrollRect m_IssueScrollRect;
|
| | | [SerializeField] UserIssueBehaviour m_IssueBehaviourPattern;
|
| | | [SerializeField] RectTransform m_ContactContainer;
|
| | | [SerializeField] Text m_QQTitle;
|
| | | [SerializeField] Text m_QQ;
|
| | | [SerializeField] Text m_Phone;
|
| | | [SerializeField] Button m_CopyQQ;
|
| | |
| | |
|
| | | private void InitContact()
|
| | | {
|
| | | var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
|
| | | m_QQ.text = Language.GetFromLocal(31, config.qq);
|
| | | var config = ContactConfig. GetConfig(VersionConfig.Get().appId, VersionConfig.Get().branch);
|
| | |
|
| | | m_QQTitle.text = Language.GetFromLocal(31);
|
| | | var qqContent = config.qq.Split('|');
|
| | | m_QQ.text = string.Join("\r\n", qqContent);
|
| | | m_CopyQQ.gameObject.SetActive(qqContent.Length == 1);
|
| | |
|
| | | m_Phone.text = Language.GetFromLocal(32, config.phone);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (Application.isMobilePlatform)
|
| | | {
|
| | | var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
|
| | | SDKUtility.Instance.CopyContent(config.qq);
|
| | | var config = ContactConfig.GetConfig(VersionConfig.Get().appId, VersionConfig.Get().branch);
|
| | | SDKUtility.Instance.CopyContent(m_QQ.text);
|
| | | m_CopySucceedTip.Display(Language.GetFromLocal(33));
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (Application.isMobilePlatform)
|
| | | {
|
| | | var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
|
| | | var config = ContactConfig.GetConfig(VersionConfig.Get().appId, VersionConfig.Get().branch);
|
| | | SDKUtility.Instance.CopyContent(config.phone);
|
| | | m_CopySucceedTip.Display(Language.GetFromLocal(33));
|
| | | }
|
| | |
| | | Str = Language.Get("Num_CHS_1");
|
| | | return Str;
|
| | | case 2:
|
| | | Str = Language.Get("Num_CHS_2");
|
| | | Str = Language.Get("Turntable5");
|
| | | return Str;
|
| | | case 3:
|
| | | Str = Language.Get("Num_CHS_3");
|
| | |
| | | RegisterModel<FlashRushToBuyModel>();
|
| | | RegisterModel<TalentModel>();
|
| | | RegisterModel<OpenServerActivityNotifyModel>();
|
| | | RegisterModel<FairyFeastModel>();
|
| | | RegisterModel<WishingPoolModel>();
|
| | | RegisterModel<RolePointModel>();
|
| | | inited = true;
|
| | |
| | |
|
| | | private void AddSreenMask()
|
| | | {
|
| | | var maskObject = UIUtility.CreateWidget("ScreenMask", "ScreenMask");
|
| | | var rectTransform = maskObject.transform as RectTransform;
|
| | | var maskObject = new GameObject("ScreenMask");
|
| | | var rectTransform = maskObject.AddMissingComponent<RectTransform>();
|
| | | rectTransform.sizeDelta = new Vector2(1336, 752);
|
| | | rectTransform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | rectTransform.SetAsFirstSibling();
|
| | | windowMask = maskObject.GetComponent<RawImage>();
|
| | | windowMask = maskObject.AddMissingComponent<RawImage>();
|
| | | }
|
| | |
|
| | | private RectTransform FindParent(WindowType _type)
|
| | |
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | | public class WindowCenter : Singleton<WindowCenter>
|
| | | |
| | |
|
| | | {
|
| | | public event Action<Window> windowBeforeOpenEvent;
|
| | | public event Action<Window> windowAfterOpenEvent;
|
| | |
| | | get {
|
| | | if (m_UIRoot == null)
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UIRoot");
|
| | | var prefab = BuiltInLoader.LoadPrefab("UIRoot");
|
| | | var instance = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity);
|
| | | instance.name = "UIRoot";
|
| | | m_UIRoot = instance.GetComponent<UIRoot>();
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var prefab = _fromLocal ? Resources.Load<GameObject>(StringUtility.Contact("UI/Prefabs/", _name)) : UILoader.LoadWindow(_name);
|
| | | var prefab = _fromLocal ? BuiltInLoader.LoadPrefab(prefabName) : UILoader.LoadWindow(prefabName);
|
| | | prefab.SetActive(false);
|
| | | var instance = GameObject.Instantiate(prefab);
|
| | | if (AssetSource.uiFromEditor)
|
| | |
| | | prefab.SetActive(true);
|
| | | }
|
| | |
|
| | | UILoader.UnLoadWindowAsset(_name);
|
| | | instance.name = _name;
|
| | | var window = instance.GetComponent<Window>();
|
| | | if (_fromLocal)
|
| | | {
|
| | | BuiltInLoader.UnLoadPrefab(prefabName);
|
| | | }
|
| | | else
|
| | | {
|
| | | UILoader.UnLoadWindowAsset(prefabName);
|
| | | }
|
| | |
|
| | | if (window != null)
|
| | | {
|
| | | windows[_name] = window;
|
| | |
| | | var uiroot = GameObject.FindObjectOfType<UIRoot>();
|
| | | if (uiroot == null)
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UIRoot");
|
| | | var prefab = BuiltInLoader.LoadPrefab("UIRoot");
|
| | | var instance = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity);
|
| | | instance.name = "UIRoot";
|
| | | uiroot = instance.GetComponent<UIRoot>();
|
| | |
| | | ImpactRankModel rankModel { get { return ModelCenter.Instance.GetModel<ImpactRankModel>(); } }
|
| | | ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | PlayerSuitModel suitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } }
|
| | |
|
| | | public bool IsJumpState { get; private set; }
|
| | | public int jumpPhase { get; private set;}
|
| | | public int jumpType { get; private set; }
|
| | |
| | | case JumpUIType.StrengthFunc4:
|
| | | case JumpUIType.StrengthFunc5:
|
| | | case JumpUIType.EquipWashType2:
|
| | | case JumpUIType.StrengthFunc1Type2:
|
| | | case JumpUIType.EquipSuitType2:
|
| | | case JumpUIType.StrengthFunc1Type2: |
| | | SetJumpLogic<EquipReinforceWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.EquipHighSuit:
|
| | | case JumpUIType.EquipLowSuit:
|
| | | int suitType = 0;
|
| | | int.TryParse(_tagWinSearchModel.SelectActive,out suitType);
|
| | | suitModel.SetJumpModel(suitType);
|
| | | SetJumpLogic<EquipReinforceWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.ComposeFunc1:
|
| | |
| | | var giftModel = ModelCenter.Instance.GetModel<OSGiftModel>();
|
| | | int giftId = 0;
|
| | | int.TryParse(_tagWinSearchModel.SelectActive, out giftId);
|
| | | if (!giftModel.CheckActivate())
|
| | | if (!giftModel.IsGiftExist(giftId))
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.coinPointTotal <= 0
|
| | | || !ModelCenter.Instance.GetModel<VipModel>().firstChargeRewardGet)
|
| | |
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GiftAlreadyBuy");
|
| | | }
|
| | | else if (giftModel.IsGiftOverdue(giftId))
|
| | | else if (!giftModel.IsGiftExist(giftId))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("MissSell");
|
| | | }
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | giftModel.jumpGiftId = giftId;
|
| | | }
|
| | | break;
|
| | | case JumpUIType.OpenServerGift:
|
| | |
| | | StrengthFunc2 = 13,
|
| | | StrengthFunc3 = 14,
|
| | | StrengthFunc4 = 15,
|
| | | EquipSuitType2 = 241, //套装界面
|
| | | EquipLowSuit = 241, //普通套装界面
|
| | | StrengthFunc5 = 16,
|
| | | EquipWashType2 = 239, //装备洗练界面
|
| | | ComposeFunc1 = 17,
|
| | |
| | | DogzFunc2Type2 = 251, //神兽强化界面
|
| | | BindGoldWheel = 252, //绑玉转盘界面
|
| | | FlashRushToBuy = 253, //精彩活动—限时抢购界面
|
| | | EquipHighSuit = 254, //强化套装界面
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | | GyzTs = 1003,//鬼牙刃功法提升界面
|
| | |
| | |
|
| | | Action m_HeroSkillCompletet;
|
| | |
|
| | | SFXController m_SkillExtraSfx;
|
| | |
|
| | | public int cacheSkillId { get; private set; }
|
| | |
|
| | | public Camera showCamera { get { return m_ShowCamera; } }
|
| | |
| | | });
|
| | | var _clip = _index != -1 ? _treasureSkill.clip[_index] : _treasureSkill.clip[0];
|
| | | ShowHeroSkill(_skillId, _clip.clip);
|
| | | if (_treasureSkill.effects != null && _treasureSkill.effects.Count > 0)
|
| | | {
|
| | | _index = _treasureSkill.effects.FindIndex((x) =>
|
| | | {
|
| | | return (int)x.job == PlayerDatas.Instance.baseData.Job;
|
| | | });
|
| | | var _effect = _index != -1 ? _treasureSkill.effects[_index] : _treasureSkill.effects[0];
|
| | | StartCoroutine(Co_PlayExtraEffect(_effect));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | StopShow();
|
| | | }
|
| | |
|
| | | IEnumerator Co_PlayExtraEffect(Effect effect)
|
| | | {
|
| | | yield return new WaitForSeconds(effect.startTime);
|
| | | if (m_SkillExtraSfx != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_SkillExtraSfx);
|
| | | m_SkillExtraSfx = null;
|
| | | }
|
| | | var parent = hero;
|
| | | if (!string.IsNullOrEmpty(effect.parentName) && hero != null)
|
| | | {
|
| | | parent = hero.GetChildTransformDeeply(effect.parentName, true);
|
| | | }
|
| | | m_SkillExtraSfx = SFXPlayUtility.Instance.Play(effect.id, parent);
|
| | | if (m_SkillExtraSfx != null)
|
| | | {
|
| | | m_SkillExtraSfx.duration = effect.duration;
|
| | | m_SkillExtraSfx.transform.localPosition = effect.position;
|
| | | }
|
| | | }
|
| | |
|
| | | public void StopShow()
|
| | | {
|
| | | UI3DTreasureSelectStage.Instance.showCamera.enabled = true;
|
| | | m_ShowCamera.gameObject.SetActive(false);
|
| | | m_HeroSkillCompletet = null;
|
| | | m_HeroShow.Dispose();
|
| | | if (m_SkillExtraSfx != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_SkillExtraSfx);
|
| | | m_SkillExtraSfx = null;
|
| | | }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | |
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public struct Effect
|
| | | {
|
| | | public PlayerJob job;
|
| | | public int id;
|
| | | public float startTime;
|
| | | public float duration;
|
| | | public string parentName;
|
| | | public Vector3 position;
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public struct TreasureSkill
|
| | | {
|
| | | public int treasureId;
|
| | | public List<CameraClip> clip;
|
| | | public List<Effect> effects;
|
| | | }
|
| | |
|
| | | public enum PlayerJob
|
| | |
| | |
|
| | | public static void CreateStage()
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UI3DModelExhibitionStage");
|
| | | var prefab = BuiltInLoader.LoadPrefab("UI3DModelExhibitionStage");
|
| | | var gameObject = GameObject.Instantiate(prefab);
|
| | | Instance = gameObject.GetComponent<UI3DModelExhibition>();
|
| | | Instance.transform.position = new Vector3(1000, 2000, 3000);
|
| | |
| | |
|
| | | static void CreateCloneStage()
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UI3DModelExhibitionStage");
|
| | | var prefab = BuiltInLoader.LoadPrefab("UI3DModelExhibitionStage");
|
| | | var gameObject = GameObject.Instantiate(prefab);
|
| | | m_InstanceClone1 = gameObject.GetComponent<UI3DModelExhibition>();
|
| | | m_InstanceClone1.transform.position = new Vector3(2000, 4000, 5000);
|
| | |
| | | get {
|
| | | if (m_Instance == null)
|
| | | {
|
| | | var gameObject = Instantiate(Resources.Load<GameObject>("UI/Prefabs/UI3DTreasureExhibitionStage"));
|
| | | var gameObject = Instantiate(BuiltInLoader.LoadPrefab("UI3DTreasureExhibitionStage"));
|
| | | m_Instance = gameObject.GetComponent<UI3DTreasureExhibition>();
|
| | | Instance.transform.position = new Vector3(0, 2000, 3000);
|
| | | m_Instance.name = "UI3DTreasureExhibitionStage";
|
| | |
| | | { |
| | | if (hudRoot == null) |
| | | { |
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/HUDRoot"); |
| | | var prefab = BuiltInLoader.LoadPrefab("HUDRoot"); |
| | | var instance = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity); |
| | | instance.name = "HUDRoot"; |
| | | hudRoot = instance.GetComponent<HUDRoot>(); |
| | |
| | | EquipCompose = 93,//装备合成
|
| | | Guard = 94,//守护
|
| | | SkillTreasure = 95,//技能法宝
|
| | | AddPoint = 96,//加点
|
| | | WingCompose = 97,//翅膀合成
|
| | | Demon = 98,//混乱妖域
|
| | | HappyFindTreasure = 99,//欢乐寻宝
|
| | |
| | | OpenServerRedEnvelope = 122,//开服红包
|
| | | EquipDecompose = 123, //装备分解
|
| | | TreasureFindHost = 124, //法宝认主
|
| | | Dogz = 138, //神兽
|
| | | AddPoint = 145,//加点
|
| | | }
|
| | | //属性类型
|
| | | public enum AttrEnum
|
| | |
| | | Def_RewardType_TreasureSoul = 9,//法宝魂奖励
|
| | | Def_RewardType_ConsumeRebate = 11,//消费返利奖励
|
| | | Def_RewardType_BossReborn = 12,//boss复活奖励
|
| | | Def_RewardType_FCRecharge = 13,// 仙界盛典充值大礼13
|
| | | Def_RewardType_FCRecharge = 13,// 仙界盛典充值大礼13W
|
| | | Def_RewardType_FCParty = 14,// 仙界盛典全民来嗨14
|
| | |
|
| | | Def_RewardType_WishingWell = 16,// 许愿池奖励16
|
| | | }
|
| | |
|
| | | public enum MapType
|
| | |
| | | UnionWarehouseDonation, //捐献装备
|
| | | UnionWarehouseExchange, //兑换装备
|
| | | GetEquipPath, //装备获取途径
|
| | | GetWingsPath,//翅膀获取途径
|
| | | }
|
| | |
|
| | | public enum InstalledAsset
|
| | |
| | | |
| | | public static void GetAllDirectoryFileInfos(string _path, List<FileInfo> _fileInfos)
|
| | | {
|
| | | UnityEngine.Debug.Log("GetAllDirectoryFileInfos path is :" + _path);
|
| | |
|
| | | var directoryInfo = new DirectoryInfo(_path);
|
| | | var allFileSystemInfos = directoryInfo.GetFileSystemInfos();
|
| | |
|