Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
| | |
| | | Horizontal, // 水平渐变 |
| | | Vertical, // 垂直渐变 |
| | | Diagonal, // 对角线渐变 |
| | | Radial, // 径向渐变 |
| | | Custom // 自定义四角颜色 |
| | | } |
| | | |
| | |
| | | SetVerticesDirty(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置径向渐变颜色 |
| | | /// </summary> |
| | | public void SetRadialGradient(Color centerColor, Color edgeColor) |
| | | { |
| | | m_GradientType = GradientType.Radial; |
| | | m_TopLeftColor = edgeColor; |
| | | m_TopRightColor = edgeColor; |
| | | m_BottomLeftColor = edgeColor; |
| | | m_BottomRightColor = edgeColor; |
| | | // 径向渐变需要在顶点着色器中处理 |
| | | SetVerticesDirty(); |
| | | } |
| | | |
| | | |
| | | protected override void OnPopulateMesh(VertexHelper vh) |
| | | { |
| | |
| | | return Color.Lerp(m_TopLeftColor, m_TopRightColor, x); |
| | | |
| | | case GradientType.Vertical: |
| | | return Color.Lerp(m_TopLeftColor, m_BottomLeftColor, y); |
| | | return Color.Lerp(m_TopLeftColor, m_BottomLeftColor, 1 - y); |
| | | |
| | | case GradientType.Diagonal: |
| | | return Color.Lerp(m_TopLeftColor, m_BottomRightColor, (x + y) * 0.5f); |
| | | // 对角线渐变:从左上到右下 |
| | | // 使用更准确的对角线计算,确保从左上到右下的渐变 |
| | | var diagonalFactor = Mathf.Clamp01((x + (1 - y)) * 0.5f); |
| | | return Color.Lerp(m_TopLeftColor, m_BottomRightColor, diagonalFactor); |
| | | |
| | | case GradientType.Radial: |
| | | var center = new Vector2(0.5f, 0.5f); |
| | | var distance = Vector2.Distance(new Vector2(x, y), center); |
| | | return Color.Lerp(m_TopLeftColor, m_BottomRightColor, distance * 2f); |
| | | |
| | | |
| | | case GradientType.Custom: |
| | | // 双线性插值 |
| | | // 双线性插值:修正Y轴方向 |
| | | var topColor = Color.Lerp(m_TopLeftColor, m_TopRightColor, x); |
| | | var bottomColor = Color.Lerp(m_BottomLeftColor, m_BottomRightColor, x); |
| | | return Color.Lerp(topColor, bottomColor, y); |
| | | return Color.Lerp(topColor, bottomColor, 1 - y); |
| | | |
| | | default: |
| | | return color; |
| | |
| | | //延迟处理特效大小 |
| | | async UniTask RefreshEffect(ItemModel equip) |
| | | { |
| | | // await UniTask.DelayFrame(3); |
| | | // if (effectID == 0) |
| | | // { |
| | | // uieffect.Stop(); |
| | | // } |
| | | // else |
| | | // { |
| | | // uieffect.Stop(); |
| | | // uieffect.effectId = effectID; |
| | | // //计算高度缩放比例 特效显示依赖rect的排版 |
| | | // uieffect.transform.localScale = new Vector3(0.98f, bgRect.rect.height / uieffect.GetComponent<RectTransform>().rect.height, 1); |
| | | // uieffect.Play(); |
| | | // } |
| | | await UniTask.DelayFrame(1); |
| | | int effectID = EquipModel.Instance.equipUIEffects[Math.Min(equip.config.ItemColor, EquipModel.Instance.equipUIEffects.Length) - 1]; |
| | | if (effectID == 0) |
| | | { |
| | | uieffect.Stop(); |
| | | } |
| | | else |
| | | { |
| | | uieffect.Stop(); |
| | | uieffect.effectId = effectID; |
| | | //计算高度缩放比例 特效显示依赖rect的排版 |
| | | uieffect.transform.localScale = new Vector3(0.98f, bgRect.rect.height / uieffect.GetComponent<RectTransform>().rect.height, 1); |
| | | uieffect.Play(); |
| | | } |
| | | |
| | | //二次处理放大效果 |
| | | await UniTask.Delay(100); |
| | |
| | | [SerializeField] UIEffectPlayer openCloseAnim; |
| | | [SerializeField] FillTween cdTween; |
| | | [SerializeField] Text hammerText; |
| | | [SerializeField] Text multiFightText; |
| | | |
| | | bool isForcePlayFightUIAnim = true; //强制播放战斗锤子框动画 |
| | | |
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | AutoFightModel.Instance.OnFightEvent += OnSkillCast; |
| | | RenameManager.Instance.OnUpdateRenameResultEvent += OnUpdateRenameResultEvent; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | base.OnPreOpen(); |
| | | |
| | | // 刷新UI |
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | AutoFightModel.Instance.OnFightEvent -= OnSkillCast; |
| | | RenameManager.Instance.OnUpdateRenameResultEvent -= OnUpdateRenameResultEvent; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | base.OnPreClose(); |
| | | isForcePlayFightUIAnim = true; |
| | | } |
| | |
| | | topBar.SetActive(functionOrder == 0 || functionOrder == 2); |
| | | } |
| | | |
| | | void OnCloseWindow(UIBase _ui) |
| | | { |
| | | if (_ui.name == "AutoFightWin") |
| | | { |
| | | multiFightText.text = Language.Get("MultiFight", AutoFightModel.Instance.fightCost); |
| | | } |
| | | } |
| | | |
| | | //战斗按钮动画 |
| | | void ClickAnimation(int index) |
| | |
| | | fightOtherWinBG.SetActive(false); |
| | | fightOtherWinWarnImg.SetActive(false); |
| | | fightBG.SetActive(true); |
| | | multiFightText.text = Language.Get("MultiFight", AutoFightModel.Instance.fightCost); |
| | | |
| | | |
| | | if (BattleManager.Instance.storyBattleField != null && |
| | |
| | | { |
| | | //非主城界面 |
| | | fightOtherWinBG.SetActive(true); |
| | | multiFightText.text = ""; |
| | | fightBG.SetActive(false); |
| | | if (BattleManager.Instance.storyBattleField != null && |
| | | BattleManager.Instance.storyBattleField.GetBattleMode() == BattleMode.Stop) |
| | |
| | | [SerializeField] Button fightBtn; |
| | | [SerializeField] Image fightIcon; |
| | | [SerializeField] ScrollerController dropItemScroller; |
| | | [SerializeField] Button heroRoadBtn; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | |
| | | }); |
| | | |
| | | fightBtn.AddListener(FightBoss); |
| | | |
| | | heroRoadBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<DayMissionBaseWin>(2); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | } |
| | | } |
| | | bossBG.SetOrgSprite(chapterConfig.BG, "MainLevel"); |
| | | |
| | | heroRoadBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DayMission)); |
| | | } |
| | | |
| | | |
| | |
| | | List<int> allGuides = new List<int>();
|
| | | public List<int> completeGuidesBuf = new List<int>();
|
| | |
|
| | | //因其他原因导致的等待显示的引导窗口,在OpenWindow时会触发复查,但时机太晚增加关闭界面时触发
|
| | | List<string> waitGuideWinNames = new List<string>(); |
| | | //因其他原因导致的等待显示的引导窗口,关闭界面时触发检查,但一般在OpenWindow就会被提前处理
|
| | | List<int> waitGuideIDs = new List<int>(); |
| | |
|
| | | bool inited = false;
|
| | |
|
| | |
| | | //关闭其他界面时复查有没需要等待的引导
|
| | | void OnCloseWindow(UIBase _ui)
|
| | | {
|
| | | foreach (var winName in waitGuideWinNames)
|
| | | if (TryStartNewBieGuides(waitGuideIDs))
|
| | | {
|
| | | var guides = GuideConfig.GetGuideListByWinName(winName);
|
| | | if (guides != null)
|
| | | {
|
| | | if (TryStartNewBieGuides(guides))
|
| | | {
|
| | | break;
|
| | | }
|
| | | }
|
| | | Debug.Log("执行等待中的引导" + JsonMapper.ToJson(waitGuideIDs));
|
| | | }
|
| | |
|
| | | if (_ui.name == "StoryBossBattleWin")
|
| | | {
|
| | | //关闭界面才会触发的引导,如主线boss打完,特殊引导
|
| | | var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.PassMainBoss);
|
| | | if (guides != null)
|
| | | {
|
| | |
| | | (config.PauseMainBattle == 1 && PackManager.Instance.GetItems(PackType.DropItem).Count > 0
|
| | | && config.WinName != "EquipExchangeWin"))
|
| | | {
|
| | | Debug.Log("引导被中断,加入等待队列 " + config.ID);
|
| | | //如果子界面是必须挂在该界面上切且没有蒙版盖住的可以增加判断
|
| | | if (!waitGuideWinNames.Contains(config.WinName))
|
| | | if (!waitGuideIDs.Contains(config.ID))
|
| | | {
|
| | | waitGuideWinNames.Add(config.WinName);
|
| | | waitGuideIDs.Add(config.ID);
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | if (waitGuideWinNames.Contains(config.WinName))
|
| | | if (waitGuideIDs.Contains(config.ID))
|
| | | {
|
| | | waitGuideWinNames.Remove(config.WinName);
|
| | | waitGuideIDs.Remove(config.ID);
|
| | | }
|
| | | currentGuide = _id;
|
| | |
|
| | | Debug.Log($"开始引导ID:{_id}");
|
| | |
|
| | | guideStep = config.Steps.Length > 0 ? config.Steps[0] : 0;
|
| | | var stepConfig = ScriptableObjectLoader.LoadSoNewBieGuideStep(guideStep);
|
| | | TryPauseStoryBattle();
|