Browse Source

自动识别时间更新为2秒

蓝色星空 1 year ago
parent
commit
ca4147e013

+ 8 - 0
Assets/Matierials.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f60aa7f36fbd3bc4a95d7a13a8b91382
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 80 - 0
Assets/Matierials/Black.mat

@@ -0,0 +1,80 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Black
+  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+  m_ValidKeywords: []
+  m_InvalidKeywords: []
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Metallic: 1
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 0, g: 0, b: 0, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
Assets/Matierials/Black.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9c6a2c1cf062f414ba14e67ad7228686
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

File diff suppressed because it is too large
+ 41 - 3
Assets/NavigatorPro.unity


+ 12 - 15
Assets/Script/ControlLocalizer.cs

@@ -1,35 +1,32 @@
 using Immersal.AR.Nreal;
+using System.Collections.Generic;
 using UnityEngine;
 
 public class ControlLocalizer: MonoBehaviour
 {
     public NRLocalizer NRLocalizer;
-    public GameObject obj;
     public GameObject irobot;
+    public List<GameObject> list = new List<GameObject>();
 
-    private float tra_X;
-    private float tra_Y;
     private float time = 0f;
 
-
-    private void Start()
-    {
-        tra_X = obj.transform.position.x;
-        tra_Y = obj.transform.position.y;
-    }
+    private bool first=false;
     void Update()
     {
         time += Time.deltaTime;
 
-        if(time > 1  && irobot.activeSelf) 
+        if(time > 2  && (irobot.activeSelf || first))
         {
             NRLocalizer.Localize();
             time= 0;
-        }
-
-        if (obj.transform.position.x != tra_X || obj.transform.position.y != tra_Y)
-        {
-            enabled= false;
+            if (!first)
+            {
+                first = true;
+                foreach(GameObject go in list)
+                {
+                    go.SetActive(true);
+                }
+            }
         }
     }
 }

Some files were not shown because too many files changed in this diff