瀏覽代碼

修改bug

lzx 12 小時之前
父節點
當前提交
45110081ae
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouWidget.cs

+ 10 - 1
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouWidget.cs

@@ -44,7 +44,16 @@ namespace Fort23.Mono
             {
                 Text_Level.text = 0 + "";
             }
-            Slider_Emotion.fillAmount = _daoYouData.emotionValue / 100;
+
+            if (_daoYouData == null)
+            {
+                Slider_Emotion.fillAmount = 1;
+            }
+            else
+            {
+                Slider_Emotion.fillAmount = _daoYouData.emotionValue / 100;
+            }
+           
 
             if (_daoYouData == null)
             {