Browse Source

修改公式-2

胡佳骏 1 năm trước cách đây
mục cha
commit
b2dd355db4
2 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 5 1
      Assets/Script/GongShi2.cs
  2. 2 1
      Assets/Scripts/UI/GameManager.cs

+ 5 - 1
Assets/Script/GongShi2.cs

@@ -48,7 +48,10 @@ public class GongShi2 : MonoBehaviour
         p2 = Vector2.zero - p1;
         newPosition = new Vector3(-p2.x, 0, -p2.y);
         GameObject go2 = WebPosObj2;
+        GameObject go3 = new GameObject();
         go2.transform.parent = parent;
+        go3.transform.parent = parent;
+        go3.transform.localPosition = newPosition;
         go2.transform.localPosition = newPosition;
         yield return new WaitForSeconds(0.1f);
         go2.transform.parent = go.transform.parent;
@@ -67,7 +70,8 @@ public class GongShi2 : MonoBehaviour
         //  Destroy(go);
         //  Destroy(go2);
         WebPosObj.transform.parent = parent;
-        WebPosObj2.transform.parent = parent;
+        Destroy(WebPosObj2);
+        WebPosObj2= go3;
     }
 
 

+ 2 - 1
Assets/Scripts/UI/GameManager.cs

@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.IO;
 using UnityEngine;
 using UnityEngine.UI;
+using XRTool.Util;
 
 /*
  * 半自动交付/自动交付
@@ -212,7 +213,7 @@ public class GameManager : MonoSingleton<GameManager>
 
     private void Start()
     {
-
+        this.gameObject.AddComponent<TimerMgr>();
         // PlayerPrefs.DeleteAll();
         isStart = false;
          m_SpoitsValueDetail = new Dictionary<int, SpoitValueDetail>();