Procházet zdrojové kódy

用命令实例化

蓝色星空 před 1 rokem
rodič
revize
efcb2235c9

+ 14 - 0
Assets/Prefab/BluePrefabs/BlueRoot.prefab

@@ -100,6 +100,7 @@ GameObject:
   m_Component:
   - component: {fileID: 5886227751517987777}
   - component: {fileID: 6577798671095520273}
+  - component: {fileID: 1758718918244431555}
   m_Layer: 0
   m_Name: BlueRoot
   m_TagString: Untagged
@@ -137,6 +138,19 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 4632509381976ba4c9f1e18039e130cd, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+--- !u!114 &1758718918244431555
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4965398655029255260}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 6c2de6865248cbf48bc9eba714d6d117, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  blueObject: {fileID: 11400000, guid: d2576af9f7ec3f744825e84161cd125b, type: 2}
 --- !u!1 &8893702449747549102
 GameObject:
   m_ObjectHideFlags: 0

+ 15 - 0
Assets/Scripts/Blue/Command/InstantiateCommand.cs

@@ -0,0 +1,15 @@
+using Blue;
+using UnityEngine;
+
+public class InstantiateCommand : ICommand
+{
+    private GameObject prefab;
+    public InstantiateCommand(GameObject prefab)
+    {
+        this.prefab = prefab;
+    }
+    public void OnExcute()
+    {
+        InstantiateSystem.Instance.InstantiatePrefab(prefab);
+    }
+}

+ 2 - 1
Assets/Scripts/Blue/ScriptableObject/PrefabsAsset.asset

@@ -12,4 +12,5 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 42bd45210da6ebd4eb8f07aaf741ea5f, type: 3}
   m_Name: PrefabsAsset
   m_EditorClassIdentifier: 
-  WarningPopUp: {fileID: 0}
+  WarningPopUp: {fileID: 2160148988178575977, guid: 725f0ac354735774cbc2e7c450ccb350,
+    type: 3}

+ 0 - 1
Assets/Scripts/Blue/System/InstantiateSystem.cs

@@ -9,6 +9,5 @@ public class InstantiateSystem : SingletonMonobehaviour<InstantiateSystem>
     public void InstantiatePrefab(GameObject prefab)
     {
         Instantiate(prefab);
-        Debug.LogError(prefab.name);
     }
 }

+ 1 - 1
Assets/Scripts/UI/SceneChoose.cs

@@ -127,7 +127,7 @@ public class SceneChoose : BaseUI
             ///Module_Notice.getInstance.SetNoticeInfo("未选择导览场景", "请先勾选要进入的场景", NoticeType.Normal, 1.7f);
             //Module_Notice.getInstance._Follower.WindowAnchor = TextAnchor.UpperCenter;
             //Module_Notice.getInstance.StartNotice(3f);
-            Instantiate(Resources.Load<GameObject>("Warning/WarningPopUp"));
+            this.SendCommand(new InstantiateCommand(InstantiateSystem.Instance.BlueObject.WarningPopUp));
         }
     }
 

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -924,7 +924,6 @@ PlayerSettings:
   metroSplashScreenUseBackgroundColor: 1
   platformCapabilities:
     WindowsStoreApps:
-      CodeGeneration: False
       OfflineMapsManagement: False
       HumanInterfaceDevice: False
       Location: False
@@ -937,6 +936,7 @@ PlayerSettings:
       InternetClientServer: False
       VideosLibrary: False
       Objects3D: False
+      InternetClient: True
       RemoteSystem: False
       BlockedChatMessages: False
       PhoneCall: False
@@ -958,7 +958,7 @@ PlayerSettings:
       RecordedCallsFolder: False
       Contacts: False
       Proximity: False
-      InternetClient: True
+      CodeGeneration: False
       BackgroundMediaPlayback: False
       EnterpriseAuthentication: False
   metroTargetDeviceFamilies: