Browse Source

上传脚本,修复预制体Miss

蓝色星空 1 year ago
parent
commit
fc96da9b17

+ 2 - 1
.gitignore

@@ -40,4 +40,5 @@
 /Assets/GHZSDK/*
 /Assets/AVProPlayer/*
 /Assets/Immersal/*
-/Assets/NRSDK
+/Assets/NRSDK
+Assets/TextMesh Pro/*

+ 46 - 0
Assets/Game/Blue/0.F/BlueRoot.prefab

@@ -0,0 +1,46 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &8253213312023144010
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 3274897787036747888}
+  - component: {fileID: 5869122083670888403}
+  m_Layer: 0
+  m_Name: BlueRoot
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &3274897787036747888
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8253213312023144010}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &5869122083670888403
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8253213312023144010}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: efb17cf06ae01a9439af31afa921a9ae, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 

+ 7 - 0
Assets/Game/Blue/0.F/BlueRoot.prefab.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 9e1deb76e7ead614da932413e318b2fc
+PrefabImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 29 - 0
Assets/Game/Blue/0.F/SingletonMonobehaviour.cs

@@ -0,0 +1,29 @@
+using UnityEngine;
+
+namespace Blue
+{
+    public class SingletonMonobehaviour<T> : AbstractController where T:SingletonMonobehaviour<T>
+    {
+        private static T _instance;
+
+        public static T Instance
+        {
+            get => _instance;
+        }
+
+        public virtual void OnAwake() { }
+        private void Awake()
+        {
+            if (_instance == null)
+            {
+                _instance = this.GetComponent<T>();
+                _instance.OnAwake();
+                DontDestroyOnLoad(_instance);
+            }
+            else
+            {
+                Destroy(gameObject);
+            }
+        }
+    }
+}

+ 11 - 0
Assets/Game/Blue/0.F/SingletonMonobehaviour.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a16a9f1f044fe9e418721fc23382b0b8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 0
Assets/Game/Blue/Command/LoginCommand.cs

@@ -0,0 +1,15 @@
+using Blue;
+
+namespace GHZLangChao
+{
+    /// <summary>
+    /// 登录命令
+    /// </summary>
+    public struct LoginCommand : ICommand
+    {
+        public void OnExcute()
+        {
+            this.GetService<ILoginService>().Login();
+        }
+    }
+}

+ 11 - 0
Assets/Game/Blue/Command/LoginCommand.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5497061d51edbb34491da8c8a4d432d7
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
Assets/Game/Blue/Event/LoginSuccessEvent.cs

@@ -0,0 +1,12 @@
+using Blue;
+
+namespace GHZLangChao
+{
+    /// <summary>
+    /// 登录成功事件
+    /// </summary>
+    public struct LoginSuccessEvent : IEvent
+    {
+
+    }
+}

+ 11 - 0
Assets/Game/Blue/Event/LoginSuccessEvent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 83ee87c620652f34b8f0577e72f51919
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 15
Assets/Game/Blue/GHZLangChao.cs

@@ -1,23 +1,27 @@
 using Blue;
 
-public class GHZLangChao : AbstractArchitecture<GHZLangChao>
+namespace GHZLangChao
 {
-    protected override void Init()
+    public class GHZLangChao : AbstractArchitecture<GHZLangChao>
     {
-        RegisterModel();
-        RegisterService();
-        RegisterUtility();
-    }
+        protected override void Init()
+        {
+            RegisterModel();
+            RegisterService();
+            RegisterUtility();
+        }
 
-    private void RegisterModel()
-    {
-    }
+        private void RegisterModel()
+        {
+        }
 
-    private void RegisterService()
-    {
-    }
+        private void RegisterService()
+        {
+            this.RegisterService<ILoginService>(new LoginService());
+        }
 
-    private void RegisterUtility()
-    {
+        private void RegisterUtility()
+        {
+        }
     }
-}
+}

+ 33 - 0
Assets/Game/Blue/Service/ILoginService.cs

@@ -0,0 +1,33 @@
+using System.Collections;
+using Blue;
+using UnityEngine;
+
+namespace GHZLangChao
+{
+    /// <summary>
+    /// 登录成功事件
+    /// </summary>
+    public interface ILoginService : IService
+    {
+        void Login();
+    }
+
+    public class LoginService : ILoginService
+    {
+        public void OnInit()
+        {
+
+        }
+
+        public void Login()
+        {
+            CoroutineSystem.Instance.Start_Coroutine(LoginImitate());
+        }
+
+        private IEnumerator LoginImitate()
+        {
+            yield return new WaitForSeconds(3);
+            this.SendEvent<LoginSuccessEvent>();
+        }
+    }
+}

+ 11 - 0
Assets/Game/Blue/Service/ILoginService.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4aad372645ee94d45ad978f76d4fec90
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 25 - 0
Assets/Game/Blue/System/CoroutineSystem.cs

@@ -0,0 +1,25 @@
+using System.Collections;
+using UnityEngine;
+using Blue;
+
+namespace GHZLangChao
+{
+    public class CoroutineSystem : SingletonMonobehaviour<CoroutineSystem>
+    {
+        /// <summary>
+        /// 启动一个协程
+        /// </summary>
+        public Coroutine Start_Coroutine(IEnumerator coroutine)
+        {
+            return StartCoroutine(coroutine);
+        }
+
+        /// <summary>
+        /// 停止一个协程序
+        /// </summary>
+        public void Stop_Coroutine(Coroutine routine)
+        {
+            StopCoroutine(routine);
+        }
+    }
+}

+ 11 - 0
Assets/Game/Blue/System/CoroutineSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: efb17cf06ae01a9439af31afa921a9ae
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 4 - 4
Assets/Game/PrefabTemplate/DeviceInfo.prefab

@@ -188,7 +188,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 5aa7bb4a1e76b9a4bb6d24ac899d394f, type: 3}
+  m_Sprite: {fileID: 21300000, guid: 90f9396cdc10d8f458d493487e1f3b9a, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -585,7 +585,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 5aa7bb4a1e76b9a4bb6d24ac899d394f, type: 3}
+  m_Sprite: {fileID: 21300000, guid: 90f9396cdc10d8f458d493487e1f3b9a, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -743,7 +743,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 5aa7bb4a1e76b9a4bb6d24ac899d394f, type: 3}
+  m_Sprite: {fileID: 21300000, guid: 90f9396cdc10d8f458d493487e1f3b9a, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -820,7 +820,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 5aa7bb4a1e76b9a4bb6d24ac899d394f, type: 3}
+  m_Sprite: {fileID: 21300000, guid: 90f9396cdc10d8f458d493487e1f3b9a, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1

+ 21 - 10
Assets/Game/ShowLogin/LangChaoLogin.cs

@@ -1,16 +1,27 @@
-using UnityEngine;
+using Blue;
 
-public class LangChaoLogin : MonoBehaviour
+namespace GHZLangChao
 {
-    // Start is called before the first frame update
-    void Start()
+    public class LangChaoLogin : AbstractController
     {
-        
-    }
 
+        private void Awake()
+        {
+            this.RegisterEvent<LoginSuccessEvent>(LoginSuccess);
+        }
 
-    public void GotoChoose()
-    {
-        ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose);
+
+        public void GotoChoose()
+        {
+            this.SendCommand<LoginCommand>();
+        }
+
+        private void LoginSuccess(LoginSuccessEvent e)
+        {
+            //MachineRoomManager.Instance.Init();
+
+            ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose);
+        }
     }
-}
+
+}

+ 60 - 4
Assets/Scenes/LangChao.unity

@@ -274,7 +274,7 @@ Transform:
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 0}
-  m_RootOrder: 2
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!114 &473193879
 MonoBehaviour:
@@ -398,7 +398,7 @@ Transform:
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 0}
-  m_RootOrder: 0
+  m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
 --- !u!1 &754090226
 GameObject:
@@ -598,7 +598,7 @@ RectTransform:
   m_Children:
   - {fileID: 1990114660}
   m_Father: {fileID: 0}
-  m_RootOrder: 1
+  m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
@@ -872,7 +872,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 55d86a86da9b1674489340987e1f67f2, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  global: 1
 --- !u!1 &1994910546
 GameObject:
   m_ObjectHideFlags: 0
@@ -925,3 +924,60 @@ MonoBehaviour:
   Prefab:
   - {fileID: 5466424356445212314, guid: 12783c5d66cd4fd418eaf1675e8394e6, type: 3}
   window: []
+--- !u!1001 &166796295516227543
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications:
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_RootOrder
+      value: 4
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3274897787036747888, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8253213312023144010, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}
+      propertyPath: m_Name
+      value: BlueRoot
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: 9e1deb76e7ead614da932413e318b2fc, type: 3}

+ 8 - 0
Assets/TextMesh Pro.meta

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

+ 1 - 1
Assets/XR/Loaders/Ximmerse XR Loader.asset

@@ -12,4 +12,4 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 44820cf310472441e952b611b9f17c14, type: 3}
   m_Name: Ximmerse XR Loader
   m_EditorClassIdentifier: 
-  settings: {fileID: 0}
+  settings: {fileID: 11400000, guid: 23cd6915de35a674f8324eb40c76b4c2, type: 2}