Explorar o código

匹配界面重复则销毁

lvjincheng %!s(int64=4) %!d(string=hai) anos
pai
achega
f96af9b818
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Assets/BowArrow/Scripts/View/PKMatchingView.cs

+ 1 - 0
Assets/BowArrow/Scripts/View/PKMatchingView.cs

@@ -24,6 +24,7 @@ public class PKMatchingView : MonoBehaviour
     [NonSerialized] public bool isTryAgainInvitee;  
 
     public static PKMatchingView Create() {
+        if (ins && ins.gameObject) Destroy(ins.gameObject);
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/PKMatchingView"));
         o.SetActive(true);
         return o.GetComponent<PKMatchingView>();