瀏覽代碼

修改打字机颜色代码

lzx 3 天之前
父節點
當前提交
0bba953f96

+ 31 - 2
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanel.cs

@@ -507,8 +507,37 @@ namespace Fort23.Mono
                 if (_currShowTime > _showTime)
                 {
                     _currShowTime -= _showTime;
-                    _sb.Append(_currShowMessage[_currShowIndex]);
-                    _currShowIndex++;
+                    
+                    string v = _currShowMessage[_currShowIndex].ToString();
+                    if (v == "<")
+                    {
+                        int count = 0;
+                        int endIndex = 0;
+                        for (int i = _currShowIndex; i < _currShowMessage.Length - 1; i++)
+                        {
+                            count++;
+                            string ve = _currShowMessage[i].ToString();
+                            _sb.Append(ve);
+                            if (ve == ">")
+                            {
+                                string ve1 =  _currShowMessage[i - 1].ToString();
+                                if (ve1 == "r")
+                                {
+                                    endIndex = i;
+                                    break;
+                                }
+                            }
+                        }
+                        _currShowIndex += count;
+                    }
+                    else
+                    {
+                        _sb.Append(_currShowMessage[_currShowIndex]);
+                        _currShowIndex++;
+                    }
+                    
+                    
+                  
                     showText.text = _sb.ToString();
                 }
             }

+ 1 - 1
Assets/Scripts/GameUI/UI/GuidePanel/Phases/Phase9.cs

@@ -83,7 +83,7 @@ namespace Fort23.Mono.Phases
             await ctask;
             pgm.SetOnClickMask(false);
             CombatController.currActiveCombat.isUpdate = false;
-            GameObject gameObject = UIManager.Instance.GetComponent<CombatPanel>().magicWeapons[0].own;
+            GameObject gameObject = UIManager.Instance.GetComponent<CombatPanel>().magicWeapons[0].bg_hui.gameObject;
             Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
             Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;