Merge branch 'master' into 1871天赋功能
| | |
| | | progress = 0.1f;
|
| | | break;
|
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.FullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | if (!SDKUtility.Instance.AssetCopyFinished)
|
| | | {
|
| | | m_CurrentStage = LaunchStage.AssetCopy;
|
| | | progressBuf = progress;
|
| | |
|
| | | var allFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.Instance.StreamingAssetPath, allFiles);
|
| | |
|
| | | var count = allFiles.Count;
|
| | | var index = 0;
|
| | | while (index < count)
|
| | | {
|
| | | try
|
| | | {
|
| | | var fileInfo = allFiles[index];
|
| | | var destPath = fileInfo.FullName.Replace(ResourcesPath.Instance.StreamingAssetPath, ResourcesPath.Instance.ExternalStorePath);
|
| | | if (File.Exists(destPath))
|
| | | {
|
| | | index++;
|
| | | continue;
|
| | | }
|
| | |
|
| | | var destDirectoryName = Path.GetDirectoryName(destPath);
|
| | | if (!Directory.Exists(destDirectoryName))
|
| | | {
|
| | | Directory.CreateDirectory(destDirectoryName);
|
| | | }
|
| | |
|
| | | DebugEx.LogFormat("拷贝文件:{0}", fileInfo.Name);
|
| | | File.Copy(fileInfo.FullName, destPath, true);
|
| | | index++;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | progress = Mathf.Clamp(progressBuf + ((float)index / count) * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | }
|
| | |
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | LocalSave.SetString("AssetCopyCompleted_IOS", VersionConfig.Get().version);
|
| | | }
|
| | | break;
|
| | | case InstalledAsset.NullAsset:
|
| | | progress = 0.1f;
|
| | | break;
|
| | | }
|
| | | #endif
|
| | |
|
| | | OperationLogCollect.Instance.RecordLauchEvent(2);
|
| | | OperationLogCollect.Instance.RecordEvent(2);
|
| | |
|
| | | m_CurrentStage = LaunchStage.ClientVersion;
|
| | | if (!Application.isEditor || InGameDownTestUtility.enable)
|
| | |
| | | yield return null;
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | |
|
| | | m_CurrentStage = LaunchStage.ClientVersion;
|
| | | if (!Application.isEditor || InGameDownTestUtility.enable)
|
| | | {
|
| | | VersionUtility.Instance.RequestVersionCheck();
|
| | | progressBuf = progress;
|
| | | timer = 0f;
|
| | | duration = 1f;
|
| | |
|
| | | while (!VersionUtility.Instance.completed)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.1f, progressBuf, progressBuf + 0.1f);
|
| | | yield return null;
|
| | | }
|
| | | }
|
| | |
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 1)
|
| | | {
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.FullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | if (!SDKUtility.Instance.AssetCopyFinished)
|
| | | {
|
| | | m_CurrentStage = LaunchStage.AssetCopy;
|
| | | progressBuf = progress;
|
| | |
|
| | | var allFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.Instance.StreamingAssetPath, allFiles);
|
| | |
|
| | | var count = allFiles.Count;
|
| | | var index = 0;
|
| | | while (index < count)
|
| | | {
|
| | | try
|
| | | {
|
| | | var fileInfo = allFiles[index];
|
| | | var destPath = fileInfo.FullName.Replace(ResourcesPath.Instance.StreamingAssetPath, ResourcesPath.Instance.ExternalStorePath);
|
| | | if (File.Exists(destPath))
|
| | | {
|
| | | index++;
|
| | | continue;
|
| | | }
|
| | |
|
| | | var destDirectoryName = Path.GetDirectoryName(destPath);
|
| | | if (!Directory.Exists(destDirectoryName))
|
| | | {
|
| | | Directory.CreateDirectory(destDirectoryName);
|
| | | }
|
| | |
|
| | | DebugEx.LogFormat("拷贝文件:{0}", fileInfo.Name);
|
| | | File.Copy(fileInfo.FullName, destPath, true);
|
| | | index++;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | progress = Mathf.Clamp(progressBuf + ((float)index / count) * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | }
|
| | |
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | LocalSave.SetString("AssetCopyCompleted_IOS", VersionConfig.Get().version);
|
| | | }
|
| | | break;
|
| | | case InstalledAsset.NullAsset:
|
| | | progress = 0.1f;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | #endif
|
| | |
|
| | | OperationLogCollect.Instance.RecordLauchEvent(2);
|
| | | OperationLogCollect.Instance.RecordEvent(2);
|
| | |
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 1)
|
| | | {
|
| | |
| | | if (m_TimeCount > 0.75f)
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopKillUntilDieAI();
|
| | |
|
| | | skillContainer.blinkSkill.GetComponent<SkillButton>().enabled = false;
|
| | | skillContainer.blinkSkill.transform.localScale = Vector3.one;
|
| | |
|
| | | Transform _temp = skillContainer.blinkSkill.transform.Find("Img_BackGround");
|
| | |
| | |
|
| | | _temp = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/JoyStick");
|
| | | _temp.gameObject.SetActive(false);
|
| | |
|
| | | |
| | |
|
| | | m_Step = 12;
|
| | | m_TimeCount = 0;
|
| | |
| | | if (m_TimeCount > 0.4f)
|
| | | {
|
| | | Time.timeScale = 0;
|
| | | skillContainer.blinkSkill.GetComponent<SkillButton>().enabled = true;
|
| | | GA_Hero.s_MapSwitching = true;
|
| | | NewGuideModel _model = ModelCenter.Instance.GetModel<NewGuideModel>();
|
| | | _model.showMask = true;
|
| | |
| | | _model.direction = 2;
|
| | | _model.pressedClose = false;
|
| | | _model.clickClosed = true;
|
| | | _model.onClose = null;
|
| | | // () =>
|
| | | // {
|
| | | // Time.timeScale = 1;
|
| | | // GA_Hero.s_MapSwitching = false;
|
| | | // if (PreFightMission.Instance.m_HuaShouEffect)
|
| | | // {
|
| | | // EffectMgr.Instance.RecyleUIEffect(1050, PreFightMission.Instance.m_HuaShouEffect.gameObject);
|
| | | // PreFightMission.Instance.m_HuaShouEffect = null;
|
| | | // }
|
| | | _model.onClose = () =>
|
| | | {
|
| | | Time.timeScale = 1;
|
| | | GA_Hero.s_MapSwitching = false;
|
| | | if (PreFightMission.Instance.m_HuaShouEffect)
|
| | | {
|
| | | EffectMgr.Instance.RecyleUIEffect(1050, PreFightMission.Instance.m_HuaShouEffect.gameObject);
|
| | | PreFightMission.Instance.m_HuaShouEffect = null;
|
| | | }
|
| | |
|
| | | // if (m_UIEffect)
|
| | | // {
|
| | | // EffectMgr.Instance.RecyleUIEffect(m_UIEffect.effect, m_UIEffect.gameObject);
|
| | | // m_UIEffect = null;
|
| | | // }
|
| | | PlayerDatas.Instance.hero.CastSkill(190);
|
| | | |
| | | if (m_UIEffect)
|
| | | {
|
| | | EffectMgr.Instance.RecyleUIEffect(m_UIEffect.effect, m_UIEffect.gameObject);
|
| | | m_UIEffect = null;
|
| | | }
|
| | |
|
| | | // Transform _temp1 = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/JoyStick");
|
| | | // _temp1.gameObject.SetActive(true);
|
| | | // };
|
| | | Transform _temp1 = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/JoyStick");
|
| | | _temp1.gameObject.SetActive(true);
|
| | | };
|
| | |
|
| | | WindowCenter.Instance.Open<NewGuideWin>();
|
| | |
|
| | | HeroBehaviour.OnUserClickSkill += OnCastSkill;
|
| | |
| | | }
|
| | |
|
| | | if (NextAction == GAStaticDefine.Act_Dead
|
| | | || m_BeatCurve == null)
|
| | | || m_BeatCurve == null
|
| | | || ActorInfo.serverDie)
|
| | | {
|
| | | m_Beating = false;
|
| | | return;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, _assetKey);
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.StreamingAssetPath, _assetKey);
|
| | | }
|
| | |
|
| | | return path;
|
| | |
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | if (isOpenPrompting)
|
| | | {
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BlastFurnace114",sumCnt,getMoney,string.Format("<Img chat={0}/>",StringUtility.Contact("Money_Type_",27))),
|
| | | Language.Get("ConfirmCancel102"),(bool isOk, bool isToggle) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if(unBindCnt > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BlastFurnace115", unBindCnt),
|
| | | (bool isRecycle) =>
|
| | | {
|
| | | if (isRecycle)
|
| | | {
|
| | | SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | }
|
| | | }
|
| | | isOpenPrompting = !isToggle;
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | if (unBindCnt > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BlastFurnace115", unBindCnt),
|
| | | (bool isRecycle) =>
|
| | | {
|
| | | if (isRecycle)
|
| | | {
|
| | | SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | }
|
| | | }
|
| | | SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | //if (isOpenPrompting)
|
| | | //{
|
| | | // ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BlastFurnace114",sumCnt,getMoney,string.Format("<Img chat={0}/>",StringUtility.Contact("Money_Type_",27))),
|
| | | // Language.Get("ConfirmCancel102"),(bool isOk, bool isToggle) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | // if(unBindCnt > 0)
|
| | | // {
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BlastFurnace115", unBindCnt),
|
| | | // (bool isRecycle) =>
|
| | | // {
|
| | | // if (isRecycle)
|
| | | // {
|
| | | // SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | // }
|
| | | // });
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | // }
|
| | | // }
|
| | | // isOpenPrompting = !isToggle;
|
| | | // });
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // if (unBindCnt > 0)
|
| | | // {
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BlastFurnace115", unBindCnt),
|
| | | // (bool isRecycle) =>
|
| | | // {
|
| | | // if (isRecycle)
|
| | | // {
|
| | | // SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | // }
|
| | | // });
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // SendRecycleDrugQuest(recycleDanDict.Keys.ToList(), recycleDanDict.Values.ToList());
|
| | | // }
|
| | | //}
|
| | |
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Vector2 m_LogoPosition;
|
| | | public Vector2 logoPosition { get { return m_LogoPosition; } }
|
| | |
|
| | | [SerializeField] string m_BanHao;
|
| | | public string banHao { get { return m_BanHao; } }
|
| | |
|
| | | public void Read(string _data)
|
| | | {
|
| | | var dataStrings = _data.Split('\t');
|
| | |
| | | m_DebugVersion = int.Parse(dataStrings[16]) == 1;
|
| | | m_IsBanShu = int.Parse(dataStrings[17]) == 1;
|
| | | m_LogoPosition = dataStrings[18].Vector3Parse();
|
| | | m_BanHao = dataStrings[19];
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | | _to.m_IsBanShu = _from.m_IsBanShu;
|
| | | _to.m_ClientPackageFlag = _from.m_ClientPackageFlag;
|
| | | _to.m_LogoPosition = _from.m_LogoPosition;
|
| | | _to.m_BanHao = _from.m_BanHao;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | public class VersionUpdateWin : Window
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerHint;
|
| | | [SerializeField] RichText m_Content;
|
| | | [SerializeField] RichText m_HintDescription;
|
| | | [SerializeField] RectTransform m_UpdateContentContainer;
|
| | | [SerializeField] RichText m_UpdateCotent;
|
| | | [SerializeField] Button m_Confirm;
|
| | |
|
| | | [SerializeField] Transform m_ContainerProgress;
|
| | |
| | | private void DisplayHintContent()
|
| | | {
|
| | | var step = VersionUtility.Instance.step;
|
| | |
|
| | | switch (step)
|
| | | {
|
| | | case VersionUtility.Step.None:
|
| | | m_Content.text = Language.GetFromLocal(4);
|
| | | m_HintDescription.text = Language.GetFromLocal(4);
|
| | | break;
|
| | | case VersionUtility.Step.ApkExist:
|
| | | m_Content.text = Language.GetFromLocal(5);
|
| | | m_HintDescription.text = Language.GetFromLocal(5);
|
| | | break;
|
| | | case VersionUtility.Step.DownLoadPrepared:
|
| | | if (Application.platform == RuntimePlatform.Android)
|
| | |
| | | switch (Application.internetReachability)
|
| | | {
|
| | | case NetworkReachability.NotReachable:
|
| | | m_Content.text = Language.GetFromLocal(6, sizeDescription);
|
| | | m_HintDescription.text = Language.GetFromLocal(6, sizeDescription);
|
| | | break;
|
| | | case NetworkReachability.ReachableViaCarrierDataNetwork:
|
| | | m_Content.text = Language.GetFromLocal(7, sizeDescription);
|
| | | m_HintDescription.text = Language.GetFromLocal(7, sizeDescription);
|
| | | break;
|
| | | case NetworkReachability.ReachableViaLocalAreaNetwork:
|
| | | m_Content.text = Language.GetFromLocal(8, sizeDescription);
|
| | | m_HintDescription.text = Language.GetFromLocal(8, sizeDescription);
|
| | | break;
|
| | | }
|
| | | }
|
| | | else if (Application.platform == RuntimePlatform.IPhonePlayer)
|
| | | {
|
| | | m_Content.text = Language.GetFromLocal(9);
|
| | | m_HintDescription.text = Language.GetFromLocal(9);
|
| | | }
|
| | | break;
|
| | | case VersionUtility.Step.DownLoad:
|
| | | m_Content.text = Language.GetFromLocal(3);
|
| | | m_HintDescription.text = Language.GetFromLocal(3);
|
| | | break;
|
| | | case VersionUtility.Step.DownLoadFailed:
|
| | | m_Content.text = Language.GetFromLocal(10);
|
| | | m_HintDescription.text = Language.GetFromLocal(10);
|
| | | break;
|
| | | }
|
| | |
|
| | | switch (step)
|
| | | {
|
| | | case VersionUtility.Step.ApkExist:
|
| | | case VersionUtility.Step.DownLoadPrepared:
|
| | | var updateContent = VersionUtility.Instance.GetUpdateContent();
|
| | | if (string.IsNullOrEmpty(updateContent))
|
| | | {
|
| | | m_UpdateContentContainer.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_UpdateContentContainer.gameObject.SetActive(true);
|
| | | m_UpdateCotent.text = updateContent;
|
| | | }
|
| | | break;
|
| | | default:
|
| | | m_UpdateContentContainer.gameObject.SetActive(false);
|
| | | break;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void Confirm()
|
| | |
| | | VersionUtility.Instance.RequestVersionCheck();
|
| | | break;
|
| | | case VersionUtility.Step.ApkExist:
|
| | | var version = VersionUtility.Instance.versionInfo.GetLatestVersion();
|
| | | var remoteURL = version.download_url;
|
| | | var fileName = Path.GetFileName(remoteURL);
|
| | | var apkLocalURL = StringUtility.Contact(VersionUtility.Instance.androidRoot, "/", fileName);
|
| | | SDKUtility.Instance.InstallAPK(apkLocalURL);
|
| | | SDKUtility.Instance.InstallAPK(VersionUtility.Instance.GetApkLocalUrl());
|
| | | break;
|
| | | case VersionUtility.Step.DownLoadPrepared:
|
| | | if (Application.platform == RuntimePlatform.Android)
|
| | |
| | | }
|
| | | else if (Application.platform == RuntimePlatform.IPhonePlayer)
|
| | | {
|
| | | Application.OpenURL(VersionUtility.Instance.versionInfo.GetLatestVersion().download_url);
|
| | | Application.OpenURL(VersionUtility.Instance.GetApkRemoteUrl());
|
| | | //打开应用商店链接
|
| | | }
|
| | | break;
|
| | |
| | |
|
| | | public string androidRoot { get { return StringUtility.Contact(SDKUtility.Instance.DeviceRootPath, "/", VersionConfig.Get().bundleIdentifier); } }
|
| | |
|
| | | public float progress
|
| | | {
|
| | | public float progress {
|
| | | get { return RemoteFile.TotalDownloadedSize / ((float)versionInfo.GetLatestVersion().file_size * 1024); }
|
| | | }
|
| | |
|
| | | public string apkLocalURL = string.Empty;
|
| | | public VersionInfo versionInfo { get; private set; }
|
| | | public MaoErVersion maoerVersion;
|
| | | public bool completed { get { return step == Step.Completed; } }
|
| | |
|
| | | Step m_Step = Step.None;
|
| | | public Step step
|
| | | {
|
| | | public Step step {
|
| | | get { return m_Step; }
|
| | | private set
|
| | | {
|
| | | private set {
|
| | | if (m_Step != value)
|
| | | {
|
| | | m_Step = value;
|
| | |
| | | if (_ok)
|
| | | {
|
| | | versionInfo = JsonMapper.ToObject<VersionInfo>(_result);
|
| | | if (versionInfo.VersionCount > 0)
|
| | | if (NeedUpdate())
|
| | | {
|
| | | var version = versionInfo.GetLatestVersion();
|
| | | var remoteURL = version.download_url;
|
| | |
|
| | | switch (Application.platform)
|
| | | {
|
| | | case RuntimePlatform.Android:
|
| | | var fileName = Path.GetFileName(remoteURL);
|
| | | apkLocalURL = StringUtility.Contact(androidRoot, "/", fileName);
|
| | | if (File.Exists(apkLocalURL))
|
| | | if (File.Exists(GetApkLocalUrl()))
|
| | | {
|
| | | step = Step.ApkExist;
|
| | | WindowCenter.Instance.OpenFromLocal<VersionUpdateWin>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool NeedUpdate()
|
| | | {
|
| | | if (IsMaoErGame())
|
| | | {
|
| | | return versionInfo.downAsset == 0 && versionInfo.VersionCount > 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | return versionInfo.downAsset == 1 && versionInfo.VersionCount > 0;
|
| | | }
|
| | | }
|
| | |
|
| | | public string GetApkLocalUrl()
|
| | | {
|
| | | if (IsMaoErGame())
|
| | | {
|
| | | return StringUtility.Contact(androidRoot, "/", "maoErGame.apk");
|
| | | }
|
| | | else
|
| | | {
|
| | | var remoteURL = GetApkRemoteUrl();
|
| | | var fileName = Path.GetFileName(remoteURL);
|
| | | return StringUtility.Contact(androidRoot, "/", fileName);
|
| | | }
|
| | | }
|
| | |
|
| | | public string GetApkRemoteUrl()
|
| | | {
|
| | | if (IsMaoErGame())
|
| | | {
|
| | | return maoerVersion.url;
|
| | | }
|
| | | else
|
| | | {
|
| | | var version = versionInfo.GetLatestVersion();
|
| | | return version.download_url;
|
| | | }
|
| | | }
|
| | |
|
| | | public string GetUpdateContent()
|
| | | {
|
| | | if (IsMaoErGame())
|
| | | {
|
| | | if (string.IsNullOrEmpty(maoerVersion.content))
|
| | | {
|
| | | return string.Empty;
|
| | | }
|
| | | else
|
| | | {
|
| | | return StringUtility.Contact(Language.GetFromLocal(30), "\r\n", maoerVersion.content);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | public void StartDownLoad()
|
| | | {
|
| | | step = Step.DownLoad;
|
| | | var version = versionInfo.GetLatestVersion();
|
| | | var remoteURL = version.download_url;
|
| | | var fileName = Path.GetFileName(remoteURL);
|
| | | apkLocalURL = StringUtility.Contact(androidRoot, "/", fileName);
|
| | | var remoteURL = GetApkRemoteUrl();
|
| | | var apkLocalUrl = GetApkLocalUrl();
|
| | |
|
| | | RemoteFile.Prepare();
|
| | |
|
| | | var remoteFile = new RemoteFile();
|
| | | remoteFile.Init(remoteURL, apkLocalURL, null);
|
| | | remoteFile.Init(remoteURL, apkLocalUrl, null);
|
| | | remoteFile.Begin(OnDownLoadApkCompleted);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | SDKUtility.Instance.InstallAPK(apkLocalURL);
|
| | | SDKUtility.Instance.InstallAPK(GetApkLocalUrl());
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | step = Step.Completed;
|
| | | }
|
| | |
|
| | | const string maoerGameAppId = "mrgame";
|
| | | static List<string> maoerGameAppId = new List<string> { "mrgame", "mrgameios" };
|
| | | public bool IsMaoErGame()
|
| | | {
|
| | | return VersionConfig.Get().appId == maoerGameAppId;
|
| | | return maoerGameAppId.Contains(VersionConfig.Get().appId);
|
| | | }
|
| | |
|
| | | public void RequestMaoErVersionCheck()
|
| | | {
|
| | | if (IsMaoErGame() && versionInfo.VersionCount > 0)
|
| | | {
|
| | | step = Step.None;
|
| | | var tables = new Dictionary<string, string>();
|
| | | tables["uid"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
|
| | | var url = StringUtility.Contact("https://api.maoergame.com/update/download/url?", HttpRequest.HashtablaToString(tables));
|
| | | Debug.Log("猫耳强更url:" + url);
|
| | | HttpRequest.Instance.RequestHttpPost(url, string.Empty, HttpRequest.defaultHttpContentType, 1, OnMaoErVersionCheckResult);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnMaoErVersionCheckResult(bool ok, string result)
|
| | | {
|
| | | Debug.Log("猫耳强更 result:" + result);
|
| | | if (ok)
|
| | | {
|
| | | try
|
| | | {
|
| | | maoerVersion = JsonMapper.ToObject<MaoErVersion>(result);
|
| | | if (maoerVersion.code == 0)
|
| | | {
|
| | | step = Step.DownLoadPrepared;
|
| | | WindowCenter.Instance.OpenFromLocal<VersionUpdateWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | }
|
| | | }
|
| | |
|
| | | public class VersionInfo
|
| | |
| | | public JsonData resource_url;
|
| | | public JsonData notice_flag;
|
| | | public Version[] versions;
|
| | | public int downAsset =1;
|
| | | public int downAsset = 1;
|
| | |
|
| | | public Version GetLatestVersion()
|
| | | {
|
| | |
| | | public string version_name;
|
| | | }
|
| | |
|
| | | public struct MaoErVersion
|
| | | {
|
| | | public string msg;
|
| | | public int code;
|
| | | public string content;
|
| | | public string url;
|
| | | }
|
| | |
|
| | | public enum Step
|
| | | {
|
| | | None,
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | | WindowCenter.Instance.jumpWindowCloseEvent += CloseJumpWindow;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | ComposeModel.ResetModel();
|
| | | if(WindowJumpMgr.Instance.IsJumpState && WindowJumpMgr.Instance.jumpType == 1)
|
| | | if(WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | if(ComposeModel.CurComposeModel != null)
|
| | | {
|
| | |
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | |
|
| | | }
|
| | | if(WindowJumpMgr.Instance.jumpType != 1)
|
| | | }
|
| | |
|
| | | private void CloseJumpWindow(Window win)
|
| | | {
|
| | | if(win as ComposeWin)
|
| | | {
|
| | | ComposeModel.SetCurComposeModel(null);
|
| | | if (WindowJumpMgr.Instance.jumpPhase <= 1)
|
| | | {
|
| | | ComposeModel.SetCurComposeModel(null);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | private void OnClickRightBtn()
|
| | |
| | |
|
| | | public bool CheckIsComposeByType(int firstType,int secondType,int thirdType)
|
| | | {
|
| | | ItemCompoundConfig itemCompound = GetThirdTypeModellist(firstType,secondType,thirdType)[0];
|
| | | ItemCompoundConfig itemCompound = ItemCompoundConfig.GetItemCompoundByType(firstType, secondType, thirdType);
|
| | | if (itemCompound == null) return false;
|
| | |
|
| | | if (itemCompound.levelNeed <= PlayerDatas.Instance.baseData.LV)
|
| | | {
|
| | | return true;
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | |
| | | public void Display() |
| | | { |
| | | timer = 0f; |
| | | UI3DModelExhibition.Instance.ShowNPC(model.bigBoxNpcId, Vector3.zero, m_RawImage); |
| | | var config = Config.Instance.Get<NPCConfig>(model.bigBoxNpcId); |
| | | UI3DModelExhibition.Instance.ShowNPC(model.bigBoxNpcId, config.UIModeLOffset, config.UIModelRotation, m_RawImage); |
| | | DisplayBoxSurplusInfo(); |
| | | model.boxSurplusChangeEvent += OnBoxInfoUpdate; |
| | | } |
| | |
| | | |
| | | [SerializeField] Image m_Attention; |
| | | |
| | | protected override int selectedBossId |
| | | { |
| | | get |
| | | { |
| | | protected override int selectedBossId { |
| | | get { |
| | | return model.selectedBoss; |
| | | } |
| | | set |
| | | { |
| | | set { |
| | | model.selectedBoss = value; |
| | | } |
| | | } |
| | | |
| | | protected override InteractorableState interactorableState |
| | | { |
| | | get |
| | | { |
| | | protected override InteractorableState interactorableState { |
| | | get { |
| | | var selected = selectedBossId == bossId; |
| | | var config = Config.Instance.Get<DogzDungeonConfig>(bossId); |
| | | var dieOrLocked = false; |
| | |
| | | return selected ? InteractorableState.DieOrLockedSelected : InteractorableState.DieOrLockedUnSelected; |
| | | } |
| | | } |
| | | set |
| | | { |
| | | set { |
| | | base.interactorableState = value; |
| | | } |
| | | } |
| | | |
| | | protected override bool isUnLocked |
| | | { |
| | | get |
| | | { |
| | | protected override bool isUnLocked { |
| | | get { |
| | | return model.IsBossUnLocked(bossId); |
| | | } |
| | | } |
| | |
| | | UpdateBossPortrait(interactorableState); |
| | | } |
| | | |
| | | |
| | | protected override void DrawBossBaseInfo(string _icon, string _name, int _level, int _realm) |
| | | { |
| | | var config = Config.Instance.Get<DogzDungeonConfig>(bossId); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | m_BossName.text = _name; |
| | | m_BossLevel.text = string.Empty; |
| | | break; |
| | | case 2: |
| | | m_BossName.text = _name; |
| | | m_BossLevel.text = string.Empty; |
| | | break; |
| | | case 3: |
| | | case 4: |
| | | m_BossName.text = _name; |
| | | m_BossLevel.text = Language.Get("Z1024", _level); |
| | | break; |
| | | } |
| | | |
| | | m_Portrait.SetSprite(_icon); |
| | | m_Portrait.SetNativeSize(); |
| | | |
| | | if (m_Realm != null) |
| | | { |
| | | if (Config.Instance.ContainKey<RealmConfig>(_realm)) |
| | | { |
| | | m_Realm.gameObject.SetActive(true); |
| | | var realmConfig = Config.Instance.Get<RealmConfig>(_realm); |
| | | if (realmConfig != null) |
| | | { |
| | | m_Realm.SetSprite(realmConfig.Img); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_Realm.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OnSelected(int _bossId) |
| | | { |
| | | UpdateBossNameLevelFont(interactorableState); |
| | |
| | | case 4: |
| | | var npcDropConfig = Config.Instance.Get<NPCDropItemConfig>(_bossId); |
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); |
| | | m_SurpassLevel.gameObject.SetActive(true); |
| | | break; |
| | | } |
| | | } |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | |
| | | public void Display() |
| | | { |
| | | timer = 0f; |
| | | UI3DModelExhibition.Instance.ShowNPC(model.eliteMonsters[0], Vector3.zero, m_RawImage); |
| | | var config = Config.Instance.Get<NPCConfig>(model.eliteMonsters[0]); |
| | | UI3DModelExhibition.Instance.ShowNPC(model.eliteMonsters[0], config.UIModeLOffset, config.UIModelRotation, m_RawImage); |
| | | DisplayGuardSurplusInfo(); |
| | | model.boxSurplusChangeEvent += OnGuardInfoUpdate; |
| | | } |
| | |
| | | RewardsToOpen();
|
| | | ContentAssignment();
|
| | | int GetCylinderNumber = TaskAllocation.Instance.FairyAuNumber();//获取仙盟总环数
|
| | | if (coinTaskTip.IsFairy && GetCylinderNumber == 10)
|
| | | if (coinTaskTip.IsFairy && GetCylinderNumber == 10 && vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.AutoFairyMisstion) >= 1)
|
| | | {
|
| | | _ReceiveImageText.text = string.Format(Language.Get("TaskContinueCount_1"), Second);
|
| | | }
|
| | |
| | | item.name = StringUtility.Contact("CommonItemCell", index);
|
| | | item.gameObject.SetActive(true);
|
| | | BoxGetItemInfo itemInfo = BoxModel.getItems[index];
|
| | | PackType type = PackType.rptDeleted;
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemInfo.ItemID);
|
| | | if(itemConfig != null)
|
| | | {
|
| | | if(itemConfig.Type == 70 || (itemConfig.EquipPlace >= 101 && itemConfig.EquipPlace <= 105))
|
| | | {
|
| | | type = PackType.rptDogzItem;
|
| | | }
|
| | | }
|
| | | CommonItemBaisc itemBasic = item.transform.Find("CommonItemCell").GetComponent<CommonItemBaisc>();
|
| | | ItemCellModel cellModel = new ItemCellModel(itemInfo.ItemID, false, (ulong)itemInfo.Count, itemInfo.IsBind,
|
| | | "", PackType.rptDeleted, false, ConfigParse.Analysis(itemInfo.UserData));
|
| | | "", type, false, ConfigParse.Analysis(itemInfo.UserData));
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemInfo.ItemID,false, (ulong)itemInfo.Count,-1, itemInfo.IsBind,
|
| | | false, PackType.rptDeleted,"", ConfigParse.Analysis(itemInfo.UserData));
|
| | | false,type,"", ConfigParse.Analysis(itemInfo.UserData));
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
|
| | | });
|
| | |
| | | PlayerStrengthengDatas strengthDatas { get { return ModelCenter.Instance.GetModel<PlayerStrengthengDatas>(); } }
|
| | | MagicianModel magicianModel { get { return ModelCenter.Instance.GetModel<MagicianModel>(); } }
|
| | | TrialDungeonModel trialModel { get { return ModelCenter.Instance.GetModel<TrialDungeonModel>(); } }
|
| | | ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | |
|
| | | private int[] pushItemIds;
|
| | | public int[] pushBuffTypeIds;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if(playerPack.CheckIsDrugById(itemModel.itemId))
|
| | | {
|
| | | if(itemModel.chinItemModel.RealmLimit > PlayerDatas.Instance.baseData.realmLevel)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | }
|
| | |
|
| | | switch (itemModel.chinItemModel.Type)
|
| | | {
|
| | | case 8:
|
| | |
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | case 39:
|
| | | if(!CheckIsBetterWings(itemModel))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | case 52:
|
| | | if (!strengthDatas.IsHint(itemModel.itemId))
|
| | | {
|
| | |
| | | return isReach;
|
| | | }
|
| | |
|
| | | private bool CheckIsBetterWings(ItemModel itemModel)
|
| | | {
|
| | | if (itemModel == null) return false;
|
| | |
|
| | | bool isBetter = true;
|
| | | ItemModel putModel = playerPack.GetItemModelByIndex(PackType.rptEquip,(int)RoleEquipType.retWing);
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | List<ItemModel> itemModels = null;
|
| | | if(singlePack != null)
|
| | | {
|
| | | singlePack.GetItemCountByType((int)ItemType.Wings, out itemModels);
|
| | | }
|
| | | int[] composeTypes = itemModel.chinItemModel.JumpComposeCondi;
|
| | | bool isOpenCompose = false;
|
| | | if(composeTypes != null && composeTypes.Length >= 3)
|
| | | {
|
| | | ItemCompoundConfig itemCompound = ItemCompoundConfig.GetItemCompoundByType(composeTypes[0], composeTypes[1], composeTypes[2]);
|
| | | if (itemCompound != null)
|
| | | {
|
| | | if (itemCompound.levelNeed <= PlayerDatas.Instance.baseData.LV)
|
| | | {
|
| | | isOpenCompose = true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if(!isOpenCompose)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (putModel != null && putModel.chinItemModel.LV >= itemModel.chinItemModel.LV)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (itemModels != null)
|
| | | {
|
| | | for(int i = 0; i < itemModels.Count; i++)
|
| | | {
|
| | | if(itemModels[i].chinItemModel.JobLimit/100 == PlayerDatas.Instance.baseData.Job)
|
| | | {
|
| | | if(itemModels[i].chinItemModel.LV >= itemModel.chinItemModel.LV)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | private bool CheckIsExtendGrid(int itemId)
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | |
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.EquipDecompose)) return;
|
| | |
|
| | | if(GetCanDevourModellist() != null && GetCanDevourModellist().Count > 0)
|
| | | if(GetCanDevourModellist() != null && GetCanDevourModellist().Count >= minDevourEquipNum)
|
| | | {
|
| | | redpointEquipDecom.state = RedPointState.Simple;
|
| | | }
|
| | |
| | |
|
| | | public List<int> devourPlacelist { get; private set; }
|
| | | public int MaxDevourEquipNum { get; private set; }
|
| | | public int minDevourEquipNum { get; private set;}
|
| | | public void SetDevourEquipPlace()
|
| | | {
|
| | | devourPlacelist = new List<int>();
|
| | |
| | | devourPlacelist.Add(placeArray[i]);
|
| | | }
|
| | | MaxDevourEquipNum = int.Parse(funcConfig.Numerical2);
|
| | | minDevourEquipNum = int.Parse(funcConfig.Numerical3);
|
| | | }
|
| | |
|
| | | List<ItemModel> devourModellist = new List<ItemModel>();
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public List<ItemModel> canDevourModellist = new List<ItemModel>();
|
| | | public List<ItemModel> GetCanDevourModellist()
|
| | | {
|
| | | canDevourModellist.Clear();
|
| | | List<ItemModel> canDevourModellist = new List<ItemModel>();
|
| | | SinglePackModel singlePack = GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null
|
| | | || colorType == EquipColorType.None
|
| | |
| | | public List<ItemModel> selectDevourlist = new List<ItemModel>();
|
| | | public void GetSelectDevourList()
|
| | | {
|
| | | GetCanDevourModellist();
|
| | | selectDevourlist.Clear();
|
| | | selectDevourlist.AddRange(canDevourModellist);
|
| | | List<ItemModel> itemModels = GetCanDevourModellist();
|
| | | if (itemModels != null)
|
| | | {
|
| | | selectDevourlist.AddRange(itemModels);
|
| | | }
|
| | | }
|
| | |
|
| | | public void RefreshGetNewItem(ItemModel model)
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public bool IsReachMinDecomposeNum()
|
| | | {
|
| | | List<ItemModel> itemModels = GetCanDevourModellist();
|
| | | if(itemModels != null && itemModels.Count >= minDecomposeNum)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void SendEquipdevourQuest()
|
| | | {
|
| | | if (canDevourModellist.Count < minDecomposeNum) return;
|
| | | List<ItemModel> itemModels = GetCanDevourModellist();
|
| | | if (itemModels == null || itemModels.Count < minDecomposeNum) return;
|
| | |
|
| | | isAutoDecompose = true;
|
| | | recordAutoDecomNum = canDevourModellist.Count;
|
| | | recordAutoDecomNum = itemModels.Count;
|
| | | CA32C_tagCMEquipDecompose _petEat = new CA32C_tagCMEquipDecompose();
|
| | | byte[] _petIndex = new byte[canDevourModellist.Count];
|
| | | for (int i = 0; i < canDevourModellist.Count; i++)
|
| | | byte[] _petIndex = new byte[recordAutoDecomNum];
|
| | | for (int i = 0; i < recordAutoDecomNum; i++)
|
| | | {
|
| | | _petIndex[i] = (byte)canDevourModellist[i].itemInfo.ItemPlace;
|
| | | _petIndex[i] = (byte)itemModels[i].itemInfo.ItemPlace;
|
| | | if (itemModels[i].chinItemModel.StarLevel >= 2 |
| | | || (itemModels[i].chinItemModel.EquipPlace == 0 && itemModels[i].chinItemModel.Type != 29))
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | _petEat.IndexCount = (byte)_petIndex.Length;
|
| | | _petEat.IndexList = _petIndex;
|
| | |
| | | [SerializeField]
|
| | | private FunctionButton _depotTitle; //仓库
|
| | | [SerializeField]
|
| | | private FunctionButton _devourTitle; //仓库
|
| | | private FunctionButton _devourTitle; //装备分解
|
| | | [SerializeField]
|
| | | private FunctionButtonGroup _funcBtnGroup;
|
| | |
|
| | |
| | | base.OnActived();
|
| | | this.transform.SetAsLastSibling();
|
| | | _ornamentTitle.state = TitleBtnState.Locked;
|
| | | if(!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0)
|
| | | {
|
| | | if(playerPack.redpointEquipDecom.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = _devourTitle.order;
|
| | | }
|
| | | }
|
| | | _funcBtnGroup.TriggerByOrder(functionOrder);
|
| | | }
|
| | |
|
| | |
| | | model.ReportConfirmPreciousItem(model.currentShowItem);
|
| | | if (itemModel != null && itemModel.packType == PackType.rptItem)
|
| | | {
|
| | | PackSendQuestMgr.Instance.SendUseItemQuest(ItemWinBtnType.makeUse, itemModel.itemInfo.ItemPlace);
|
| | | switch((ItemType)itemModel.chinItemModel.Type)
|
| | | {
|
| | | case ItemType.WingsMat:
|
| | | int jumpId = 0;
|
| | | bool isUnlock = ModelCenter.Instance.GetModel<ComposeWinModel>().CheckComposeItemById(itemModel.itemId, out jumpId);
|
| | | if (isUnlock)
|
| | | {
|
| | | PackSendQuestMgr.Instance.ClickComposeBtn(ItemWinBtnType.compose, jumpId);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | PackSendQuestMgr.Instance.SendUseItemQuest(ItemWinBtnType.makeUse, itemModel.itemInfo.ItemPlace);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public SDKUtility.FP_LoginOk sdkLoginResult;
|
| | | public SDKUtility.FP_CheckIDAuthentication sdkIDCheckIDAuthentication;
|
| | |
|
| | | public string localSaveAccountName
|
| | | {
|
| | | public string localSaveAccountName {
|
| | | get { return LocalSave.GetString(USER_ACCOUNT); }
|
| | | set { LocalSave.SetString(USER_ACCOUNT, value); }
|
| | | }
|
| | |
| | | public event Action accountBindOkEvent;
|
| | |
|
| | | bool m_ReconnecBackGround = false;
|
| | | public bool reconnectBackGround
|
| | | {
|
| | | public bool reconnectBackGround {
|
| | | get { return m_ReconnecBackGround; }
|
| | | set { m_ReconnecBackGround = value; }
|
| | | }
|
| | |
|
| | | bool m_OnCreateRole = false;
|
| | | public bool onCreateRole
|
| | | {
|
| | | public bool onCreateRole {
|
| | | get { return m_OnCreateRole; }
|
| | | set { m_OnCreateRole = value; }
|
| | | }
|
| | |
|
| | | bool m_Busy = false;
|
| | | public bool busy
|
| | | {
|
| | | public bool busy {
|
| | | get { return m_Busy; }
|
| | | set { m_Busy = value; }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | SDKUtility.Instance.FreePlatformCheckIDAuthentication(sdkLoginResult.account);
|
| | |
|
| | | ServerListCenter.Instance.RequestServerListPlayer(sdkLoginResult.account);
|
| | | GameNotice.OpenGameNotice();
|
| | | SDKUtility.Instance.MakeKeyAndVisible();
|
| | | OperationLogCollect.Instance.RecordLauchEvent(5);
|
| | |
|
| | | if (VersionUtility.Instance.IsMaoErGame() && VersionUtility.Instance.NeedUpdate())
|
| | | {
|
| | | VersionUtility.Instance.RequestMaoErVersionCheck();
|
| | | }
|
| | | else
|
| | | {
|
| | | GameNotice.OpenGameNotice();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSDKAccountLoginOutOk()
|
| | |
| | | [SerializeField] Button m_ServerSelect;
|
| | | [SerializeField] Button m_SwitchAccount;
|
| | | [SerializeField] Button m_Notice;
|
| | | [SerializeField] RectTransform m_BanHao;
|
| | | [SerializeField] RichText m_BanHao;
|
| | |
|
| | | LoginModel model { get { return ModelCenter.Instance.GetModel<LoginModel>(); } }
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_BanHao.gameObject.SetActive(Application.platform == RuntimePlatform.WindowsEditor || VersionUtility.Instance.IsMaoErGame());
|
| | | m_BanHao.text = string.IsNullOrEmpty(VersionConfig.Get().banHao) ? string.Empty : VersionConfig.Get().banHao;
|
| | |
|
| | | var sprite = Resources.Load<Sprite>("UI/Sprites/TB_DL_Logo");
|
| | | m_Logo.overrideSprite = sprite;
|
| | | m_Logo.SetNativeSize();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (VersionUtility.Instance.IsMaoErGame())
|
| | | {
|
| | | if (VersionUtility.Instance.step != VersionUtility.Step.Completed)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | Login();
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | _model.currentCategory = TreasureCategory.Human;
|
| | | }
|
| | | else if (_model.GetTreasureUnlockShow(TreasureCategory.Demon) != 0)
|
| | | {
|
| | | _model.currentCategory = TreasureCategory.Demon;
|
| | | }
|
| | | else if (RedpointCenter.Instance.GetRedpointState(TreasureModel.CATEGORY_REDPOINTIDS[(int)TreasureCategory.Human - 1])
|
| | | == RedPointState.Simple)
|
| | | {
|
| | | _model.currentCategory = TreasureCategory.Human;
|
| | | }
|
| | | WindowCenter.Instance.Open<TreasureSelectWin>();
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_DeActiveFairyGrabBoss());
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_DeActiveFairyGrabBoss()
|
| | | {
|
| | | yield return null;
|
| | | if (fairyGrabBossModel.fairyGrabBossHelps.Count == 0)
|
| | | {
|
| | | m_FairyGrabBossHelpBehaviour.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
| | | if (_AllMissionDict.ContainsKey(_TaskId))
|
| | | {
|
| | |
|
| | | if (_AllMissionDict[_TaskId].Type == 7 || (_AllMissionDict[_TaskId].Type == 12 && vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.AutoFairyMisstion) >= 1))
|
| | | if (_AllMissionDict[_TaskId].Type == 7 || (_AllMissionDict[_TaskId].Type == 12 /*&& vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.AutoFairyMisstion) >= 1*/))
|
| | | {
|
| | | taskmodel.RequestGetTaskAward("OK");
|
| | | WindowCenter.Instance.CloseImmediately<TaskBoxBGMWin>();
|
| | |
| | | {
|
| | | MissionDetailDates xPack = taskmodel.allMissionDict[x];
|
| | | MissionDetailDates yPack = taskmodel.allMissionDict[y];
|
| | | bool IsMainTaskx = xPack.Type == 0;
|
| | | bool IsMainTasky = yPack.Type == 0;
|
| | | if (IsMainTaskx.CompareTo(IsMainTasky) != 0)//优先主线
|
| | | {
|
| | | return -IsMainTaskx.CompareTo(IsMainTasky);
|
| | | }
|
| | | bool IsStateTaskx = xPack.MissionState == 2;
|
| | | bool IsStateTasky = yPack.MissionState == 2;
|
| | | if (IsStateTaskx.CompareTo(IsStateTasky) != 0)//优先可领取
|
| | | {
|
| | | return -IsStateTaskx.CompareTo(IsStateTasky);
|
| | | }
|
| | |
|
| | | var _index0 = ListSort.IndexOf(xPack.Type);
|
| | | var _index1 = ListSort.IndexOf(yPack.Type);
|
| | | if (_index0.CompareTo(_index1) != 0)
|
| | |
| | | {
|
| | | MissionDetailDates xPack = taskmodel.allMissionDict[x];
|
| | | MissionDetailDates yPack = taskmodel.allMissionDict[y];
|
| | | bool IsMainTaskx = xPack.Type == 0;
|
| | | bool IsMainTasky = yPack.Type == 0;
|
| | | if (IsMainTaskx.CompareTo(IsMainTasky) != 0)//优先主线
|
| | | {
|
| | | return -IsMainTaskx.CompareTo(IsMainTasky);
|
| | | }
|
| | | bool IsStateTaskx = xPack.MissionState == 2;
|
| | | bool IsStateTasky = yPack.MissionState == 2;
|
| | | if (IsStateTaskx.CompareTo(IsStateTasky) != 0)//优先可领取
|
| | | {
|
| | | return -IsStateTaskx.CompareTo(IsStateTasky);
|
| | | }
|
| | | var _index0 = ListSort1.IndexOf(xPack.Type);
|
| | | var _index1 = ListSort1.IndexOf(yPack.Type);
|
| | | if (_index0.CompareTo(_index1) != 0)
|
| | |
| | | }
|
| | | set
|
| | | {
|
| | | if (string.IsNullOrEmpty(value))
|
| | | {
|
| | | value = string.Empty;
|
| | | }
|
| | | m_RichText = value;
|
| | | SetRichTextDirty();
|
| | | }
|
| | |
| | | public int MountStoneItemId = 0;
|
| | | public bool IsOk = false;
|
| | | public bool IsRedPointSingleFeed = true;
|
| | | public List<int> ListEffectSkill = new List<int>();
|
| | | public List<int> ListEffectSkill = new List<int>();
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | | {
|
| | |
| | | public bool Wait = true;//等待回包(使用坐骑丹)
|
| | | public static Action<int, bool> MultipleEvent;
|
| | | public static event Action PlayerLoginOKData;
|
| | | private Dictionary<int, int> DicDefaultMount = new Dictionary<int, int>();
|
| | | public override void Init()
|
| | | { |
| | | ToAddSorting(); |
| | | {
|
| | | ToAddSorting();
|
| | | playerPack.RefreshItemCountAct += OnItemRefreshEvent;
|
| | | MountWin.RedPointMountDan += RedPointMountDan;
|
| | | MountSkillAndItem();
|
| | |
| | | {
|
| | | ListEffectSkill.Add(listeffect[i]);
|
| | | }
|
| | | string MountRedDotstr = Config.Instance.Get<FuncConfigConfig>("MountPetRedDot").Numerical1;
|
| | | DicDefaultMount = ConfigParse.GetDic<int, int>(MountRedDotstr);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | foreach (var index in singPack.GetPackModelIndexDict().Keys)
|
| | | {
|
| | | OnItemRefreshEvent(singPack.packType, index, singPack.GetPackModelIndexDict()[index].itemId);
|
| | | } |
| | | }
|
| | | if (PlayerLoginOKData != null)
|
| | | {
|
| | | PlayerLoginOKData();
|
| | |
| | |
|
| | | int GetMountID = 0;
|
| | | int GetMountLv = 0;
|
| | |
|
| | | for (int i = 0; i < SortMount.Count; i++)
|
| | | {
|
| | | int horseID = SortMount[i].HorseID;
|
| | |
| | | ItemConfig _tagchine = Config.Instance.Get<ItemConfig>(int.Parse(_tagfun.Numerical1));
|
| | | HorseConfig horsecon = Config.Instance.Get<HorseConfig>(GetMountID);
|
| | | int number = playerPack.GetItemCountByID(PackType.rptItem, _tagchine.ID);
|
| | | foreach (var key in _DicHorse.Keys)//因为有成就任务限制所有 第一只坐骑红点逻辑特殊写
|
| | | {
|
| | | if (DicDefaultMount.ContainsKey(key) && DicDefaultMount[key] > _DicHorse[key].Lv
|
| | | && number > 0 && ASingleFeedRedPoint.ContainsKey(key))
|
| | | {
|
| | | ASingleFeedRedPoint[key].state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | if (ASingleFeedRedPoint.ContainsKey(GetMountID) && number > 0 && GetMountLv < horsecon.MaxLV)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.LV >= 1500)
|
| | |
| | | ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | int SkillLv = 0;
|
| | | foreach (var key in GetMountSkillAndItem.Keys)
|
| | | {
|
| | | if (GetMountSkillAndItem[key].HorseID == MountId) |
| | | if (GetMountSkillAndItem[key].HorseID == MountId)
|
| | | {
|
| | | if (GetMountSkillAndItem[key].HorseLV > SkillLv)
|
| | | {
|
| | |
| | | Type = 2;
|
| | | return Type;
|
| | | }
|
| | | } |
| | | }
|
| | | if (MainRedDot.Instance.redPointMountFunc.state == RedPointState.Simple)
|
| | | {
|
| | | Type = 1;
|
| | |
| | |
|
| | | int maxRank = horseConfig.MaxLV;
|
| | | HorseUpConfig cost = HorseUpConfig.GetHorseIDAndLV(mountCode, maxRank);
|
| | | if(cost != null)
|
| | | if (cost != null)
|
| | | {
|
| | | int[] attrIds = ConfigParse.GetMultipleStr<int>(cost.AttrType);
|
| | | int[] attrValues = ConfigParse.GetMultipleStr<int>(cost.AttrValue);
|
| | |
| | | private void OnServerOpenDayRefresh()
|
| | | {
|
| | | UpdateRanks();
|
| | | m_RankAwardCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | private void OnRefreshRankList(int type)
|
| | |
| | | public int petUpgradeToolId { get; set; }
|
| | |
|
| | | public event Action PlayerLoginOkData;
|
| | | private Dictionary<int, int> DicDefaultPet = new Dictionary<int, int>();
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | {
|
| | | ListEffectSkill.Add(listeffect[i]);
|
| | | }
|
| | | string PetRedDotstr = Config.Instance.Get<FuncConfigConfig>("MountPetRedDot").Numerical2;
|
| | | DicDefaultPet = ConfigParse.GetDic<int, int>(PetRedDotstr);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | PetAttributeWin.IsRedPointCultivate -= IsRedPointCultivate;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | |
| | | if (!Wait)
|
| | | {
|
| | | TimeSpan timeS = DateTime.Now - dateTimeA;
|
| | | if (timeS.Seconds>= 2f)
|
| | | if (timeS.Seconds >= 2f)
|
| | | {
|
| | | Wait = true;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void SendPetTrainQuest(int petIndex,int number)
|
| | | public void SendPetTrainQuest(int petIndex, int number)
|
| | | {
|
| | | CA704_tagCMPetClassUP _tagCA704 = new CA704_tagCMPetClassUP();
|
| | | _tagCA704.PetItemIndex = (byte)petIndex;
|
| | |
| | | }
|
| | | }
|
| | | int itemCount = playerPack.GetItemCountByID(PackType.rptItem, 4151);
|
| | | foreach (var key in _DicPetBack.Keys)//因为有成就任务限制所有 第一只坐骑红点逻辑特殊写
|
| | | {
|
| | | if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
|
| | | && itemCount > 0 && CultivateRedPoint.ContainsKey(key))
|
| | | {
|
| | | CultivateRedPoint[key].state = RedPointState.Simple;
|
| | | CanEssence = true;
|
| | | return;
|
| | | }
|
| | | }
|
| | | PetInfoConfig petinfo = Config.Instance.Get<PetInfoConfig>(GetPetId);
|
| | | if (PlayerDatas.Instance.baseData.LV >= 1500)
|
| | | {
|
| | | if (CultivateRedPoint.ContainsKey(GetPetId) && itemCount > 0 && RedPointMaxLv && petinfo.MaxRank> petLv)
|
| | | if (CultivateRedPoint.ContainsKey(GetPetId) && itemCount > 0 && RedPointMaxLv && petinfo.MaxRank > petLv)
|
| | | {
|
| | | CultivateRedPoint[GetPetId].state = RedPointState.Simple;
|
| | | CanEssence = true;
|
| | |
| | | CultivateRedPoint[GetPetId].state = RedPointState.Simple;
|
| | | CanEssence = true;
|
| | | }
|
| | | } |
| | | }
|
| | | }
|
| | |
|
| | | public int GetMinPetLv()
|
| | |
| | | PetInfoConfig petInfo = Config.Instance.Get<PetInfoConfig>(PetID);
|
| | | if (petInfo != null)
|
| | | {
|
| | | curPetUnlocks= ConfigParse.GetMultipleStr<int>(petInfo.SkillUnLock);
|
| | | maxskillLV = curPetUnlocks[(curPetUnlocks.Length)-1];
|
| | | curPetUnlocks = ConfigParse.GetMultipleStr<int>(petInfo.SkillUnLock);
|
| | | maxskillLV = curPetUnlocks[(curPetUnlocks.Length) - 1];
|
| | | }
|
| | | return maxskillLV;
|
| | | }
|
| | |
| | | {
|
| | | Event_H0704Add();
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public int IsPetPanelRedPointState()//用于判断当前灵宠页签是否有红点亮起
|
| | | public int IsPetPanelRedPointState()//用于判断当前灵宠页签是否有红点亮起
|
| | | {
|
| | | int Type = 0;
|
| | | foreach (var value in DeblockingRedPoint.Values)
|
| | |
| | | Type = 2;
|
| | | return Type;
|
| | | }
|
| | | } |
| | | }
|
| | | if (MainRedDot.Instance.redPonintPetFunc2.state == RedPointState.Simple)
|
| | | {
|
| | | Type = 1;
|
| | |
| | |
|
| | | #region 预览宠物碎片属性
|
| | | Dictionary<int, int> petAttrDict = new Dictionary<int, int>();
|
| | | public Dictionary<int,int> GetPetAttrAddDict(int petCode)
|
| | | public Dictionary<int, int> GetPetAttrAddDict(int petCode)
|
| | | {
|
| | | PetInfoConfig infoConfig = Config.Instance.Get<PetInfoConfig>(petCode);
|
| | | petAttrDict.Clear();
|
| | | if (infoConfig == null) return petAttrDict;
|
| | |
|
| | | int maxRank = infoConfig.MaxRank;
|
| | | PetClassCostConfig cost = PetClassCostConfig.GetPetIdAndRank(petCode,maxRank);
|
| | | PetClassCostConfig cost = PetClassCostConfig.GetPetIdAndRank(petCode, maxRank);
|
| | | int allAtkAdd = 0;
|
| | | if(cost != null)
|
| | | if (cost != null)
|
| | | {
|
| | | allAtkAdd = cost.AtkAdd;
|
| | | }
|
| | | petAttrDict.Add(7,allAtkAdd);
|
| | | petAttrDict.Add(7, allAtkAdd);
|
| | | return petAttrDict;
|
| | | }
|
| | | #endregion
|
| | |
| | | delayTime = 2;
|
| | | HeroBehaviour.OnStartHandupAI -= OnStartHandupAI;
|
| | | HeroBehaviour.OnStopHandupAI -= OnStopHandupAI;
|
| | | playerPack.ItemCntAddAct -= RefreshItemCnt;
|
| | | DeadModel.playerDieEvent -= OnPlayerDie;
|
| | | m_storeModel.RefreshBuyResultEvent -= RefreshBuySuccess;
|
| | | DeadModel.CloseRebornWinEvent -= PlayerRebornSuccess;
|
| | | HeroBehaviour.OnStartHandupAI += OnStartHandupAI;
|
| | | HeroBehaviour.OnStopHandupAI += OnStopHandupAI;
|
| | | playerPack.ItemCntAddAct += RefreshItemCnt;
|
| | | DeadModel.playerDieEvent += OnPlayerDie;
|
| | | m_storeModel.RefreshBuyResultEvent += RefreshBuySuccess;
|
| | | DeadModel.CloseRebornWinEvent += PlayerRebornSuccess;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (secondTimer > 1f)
|
| | | if (secondTimer >= 1f)
|
| | | {
|
| | | if(isGetNewItem)
|
| | | {
|
| | | secondTimer = 0f;
|
| | | delayTime -= 1;
|
| | | if (delayTime <= 0)
|
| | | {
|
| | | isGetNewItem = false;
|
| | | delayTime = 2f;
|
| | | DealBagItem();
|
| | | }
|
| | | }
|
| | | secondTimer = 0f;
|
| | | RefreshBagItem();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCnt(PackType type, int index, int id)
|
| | | {
|
| | | RefreshBagItem();
|
| | | }
|
| | |
|
| | | public void RefreshBagItem()
|
| | | {
|
| | | if (!_isAutoHangUp)
|
| | |
| | | DebugEx.Log("请开启自动挂机,否则无法出售");
|
| | | return;
|
| | | }
|
| | |
|
| | | DealBagItem();
|
| | | isGetNewItem = true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | private void DealBagItem()
|
| | | {
|
| | | if (playerPack.GetReaminGridCount(PackType.rptItem) < 5)
|
| | | if (playerPack.GetReaminGridCount(PackType.rptItem) < 5 && modelInterface.isPackResetOk)
|
| | | {
|
| | | if (HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.isAutoDevour))
|
| | | {
|
| | | List<ItemModel> list = playerPack.GetCanDevourModellist();
|
| | | if (list != null && list.Count > 0)
|
| | | if(playerPack.IsReachMinDecomposeNum())
|
| | | {
|
| | | playerPack.SendEquipdevourQuest();
|
| | | return;
|
| | |
| | | WindowCenter.Instance.Open<RolePromoteWin>();
|
| | | break;
|
| | | case RolePromoteModel.PromoteDetailType.Wash:
|
| | | WindowCenter.Instance.Open<EquipReinforceWin>(false, 4);
|
| | | WindowCenter.Instance.Open<EquipReinforceWin>(false, 3);
|
| | | break;
|
| | | case RolePromoteModel.PromoteDetailType.FairyHeart:
|
| | | WindowCenter.Instance.Open<MethodToWin>();
|
| | |
| | | public const int TREASURE_GUIDE_ID = 102;
|
| | |
|
| | | const int TREASURE_REDPOINTID = 7000;
|
| | | readonly static int[] CATEGORY_REDPOINTIDS = { 7001, 7002, 7003, 7004, 7005 };
|
| | | public readonly static int[] CATEGORY_REDPOINTIDS = { 7001, 7002, 7003, 7004, 7005 };
|
| | | const int TREASURE_REDPOINTBASE = 7100;
|
| | |
|
| | | public static int redpointIndex = 1;
|
| | |
| | | {
|
| | | var potential = m_Treasure.potentials[_index];
|
| | | potentialBriefInfos[_index].DisplayStateSfx();
|
| | | potentialBriefInfos[_index].StartLevelTween();
|
| | | //potentialBriefInfos[_index].StartLevelTween();
|
| | | var _nextPotential = GetNextPotential(potential.id);
|
| | | if (_nextPotential != 0)
|
| | | {
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, September 21, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using DG.Tweening; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class RotatePointer:MonoBehaviour {
|
| | | public bool _isRotate = false;//是否旋转 |
| | | public float Speed = 2000;//旋转速度
|
| | | public float Angle = 0; // 这个是设置停止的角度
|
| | | private float Acceleration = 0;//加速度
|
| | | private float _time;
|
| | | private bool IsRotateBool = false;//是否进行旋转
|
| | | [Header("总旋转时间")]
|
| | | public float ContinuousTime = 4;//旋转时间
|
| | | [Header("加速减速时间")]
|
| | | public float SpeedTime = 1;
|
| | | [Header("最小速度")]
|
| | | public float MinSpeed= 400;
|
| | | [Header("最大速度")]
|
| | | public float MaxSpeed = 800;
|
| | |
|
| | | |
| | | private void OnEnable()
|
| | | {
|
| | | IsRotateBool = false;
|
| | | _time = 0;
|
| | |
|
| | | Acceleration = (MaxSpeed - MinSpeed) / SpeedTime;
|
| | | }
|
| | |
|
| | | void Update()
|
| | | {
|
| | |
|
| | | if (!_isRotate)
|
| | | {
|
| | | // transform.DORotate(new Vector3(0, 0, 360 + Angle), 0.5f, RotateMode.FastBeyond360);
|
| | | return; //不旋转结束
|
| | | }
|
| | | |
| | |
|
| | | if (IsRotateBool)
|
| | | {
|
| | |
|
| | | _time += Time.deltaTime;
|
| | |
|
| | | if (_time < SpeedTime)//匀加速
|
| | | {
|
| | | Speed = MinSpeed + Acceleration * _time;
|
| | | if (Speed >= MaxSpeed)
|
| | | {
|
| | | Speed = MaxSpeed;
|
| | | }
|
| | | }
|
| | | else if (_time > ContinuousTime - SpeedTime)//匀减速
|
| | | {
|
| | | Speed = MaxSpeed - Acceleration * (_time - (ContinuousTime - SpeedTime));
|
| | | if (Speed <= MinSpeed)
|
| | | {
|
| | | Speed = MinSpeed;
|
| | | }
|
| | | }
|
| | | else//匀速
|
| | | {
|
| | | Speed = MaxSpeed;
|
| | | }
|
| | | if (_time < ContinuousTime) // 没结束
|
| | | {
|
| | | transform.Rotate(Vector3.forward * Speed * Time.deltaTime);
|
| | | }
|
| | | else
|
| | | {
|
| | | //结束,使用DoTween旋转到结束角度,耗时1秒
|
| | | //这里有个360,使用来防止指针回转的,如果不加这个360,你会看到指针倒退
|
| | | transform.DORotate(new Vector3(0, 0, 360 + Angle), 1f, RotateMode.FastBeyond360);
|
| | | _isRotate = false; // 设置不旋转
|
| | | IsRotateBool = false;
|
| | | }
|
| | | } |
| | | }
|
| | |
|
| | | //外部调用,初始化时间和打开旋转
|
| | | public void SetTime()
|
| | | {
|
| | | _time =0;
|
| | | IsRotateBool = true;
|
| | | _isRotate = true;
|
| | | }
|
| | | //外部调用,设置停止角度
|
| | | public void SetAngle(float angle)
|
| | | {
|
| | | Angle = angle;
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 172c3a5c67644144780312959c8d9b77 |
| | | timeCreated: 1537517643 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, September 21, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class WheelOfFortuneWin : Window |
| | | { |
| | | [SerializeField] Button m_LotteryBtn;
|
| | | [SerializeField] RotatePointer m_RotatePointer; |
| | | [SerializeField] Toggle m_Toggle; |
| | | [SerializeField] Button m_CloseBtn; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_LotteryBtn.AddListener(OnClickButton); |
| | | m_CloseBtn.AddListener(()=> { Close(); }); |
| | | m_Toggle.onValueChanged.AddListener(OnClickToggle); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | private void OnClickButton()
|
| | | {
|
| | | m_RotatePointer.SetTime();
|
| | | } |
| | | private void OnClickToggle(bool _bool)
|
| | | {
|
| | | if (_bool)
|
| | | {
|
| | | m_RotatePointer._isRotate = false;
|
| | | m_RotatePointer.SetAngle(m_RotatePointer.Angle);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RotatePointer._isRotate = true;
|
| | | }
|
| | |
|
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d96c4104107a562479b36326b574b15e |
| | | timeCreated: 1537517179 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | |
|
| | | public bool IsJumpState { get; private set; }
|
| | | private int jumpPhase = 0;
|
| | | public int jumpPhase { get; private set;}
|
| | | public int jumpType { get; private set; }
|
| | | public void GetPreAllOpenWin()
|
| | | {
|
| | |
| | | var npcRefreshIds = model.GetMapNPCRefreshIds(mapId);
|
| | | if (npcRefreshIds != null)
|
| | | {
|
| | | for (int i = 0; i < npcRefreshIds.Count; i++)
|
| | | foreach ( var item in npcRefreshIds)
|
| | | {
|
| | | DrawFunctionNPC(npcRefreshIds[i]);
|
| | | var config = Config.Instance.Get<mapnpcConfig>(item);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(config.NPCID);
|
| | | DrawFunctionNPC(item);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | foreach (var config in mapNpcConfigs)
|
| | | {
|
| | | var mapId = config.MapID;
|
| | | if (config.NPCType == (int)E_NpcType.Func)
|
| | | if (config.NPCID != 0)
|
| | | {
|
| | | List<string> npcRefreshIs;
|
| | | if (!mapFunctionNPCsToRefreshID.ContainsKey(mapId))
|
| | | if (config.NPCType == (int)E_NpcType.Func)
|
| | | {
|
| | | mapFunctionNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
|
| | | }
|
| | | else
|
| | | {
|
| | | npcRefreshIs = mapFunctionNPCsToRefreshID[mapId];
|
| | | }
|
| | | List<string> npcRefreshIs;
|
| | | if (!mapFunctionNPCsToRefreshID.ContainsKey(mapId))
|
| | | {
|
| | | mapFunctionNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
|
| | | }
|
| | | else
|
| | | {
|
| | | npcRefreshIs = mapFunctionNPCsToRefreshID[mapId];
|
| | | }
|
| | |
|
| | | npcRefreshIs.Add(config.RefreshID.ToString());
|
| | | }
|
| | | else if (config.NPCType == (int)E_NpcType.Flag)
|
| | | {
|
| | | List<string> npcRefreshIs;
|
| | | if (!mapCollectNPCsToRefreshID.ContainsKey(mapId))
|
| | | {
|
| | | mapCollectNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
|
| | | npcRefreshIs.Add(config.RefreshID.ToString());
|
| | | }
|
| | | else
|
| | | else if (config.NPCType == (int)E_NpcType.Flag)
|
| | | {
|
| | | npcRefreshIs = mapCollectNPCsToRefreshID[mapId];
|
| | | }
|
| | | List<string> npcRefreshIs;
|
| | | if (!mapCollectNPCsToRefreshID.ContainsKey(mapId))
|
| | | {
|
| | | mapCollectNPCsToRefreshID[mapId] = npcRefreshIs = new List<string>();
|
| | | }
|
| | | else
|
| | | {
|
| | | npcRefreshIs = mapCollectNPCsToRefreshID[mapId];
|
| | | }
|
| | |
|
| | | npcRefreshIs.Add(config.RefreshID.ToString());
|
| | | npcRefreshIs.Add(config.RefreshID.ToString());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|