Przeglądaj źródła

UIComponent增加Get方法

tanghai 7 lat temu
rodzic
commit
22a86995d9

+ 9 - 1
Unity/Assets/Hotfix/Module/UI/UIComponent.cs

@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using ETModel;
 using UnityEngine;
 
@@ -39,5 +40,12 @@ namespace ETHotfix
 			this.uis.Remove(name);
 			ui.Dispose();
 		}
+		
+		public UI Get(string name)
+		{
+			UI ui = null;
+			this.uis.TryGetValue(name, out ui);
+			return ui;
+		}
 	}
 }

+ 9 - 1
Unity/Assets/Model/Module/UI/UIComponent.cs

@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using UnityEngine;
 
 namespace ETModel
@@ -38,5 +39,12 @@ namespace ETModel
 			this.uis.Remove(name);
 			ui.Dispose();
 		}
+
+		public UI Get(string name)
+		{
+			UI ui = null;
+			this.uis.TryGetValue(name, out ui);
+			return ui;
+		}
 	}
 }

+ 0 - 1
Unity/ProjectSettings/GraphicsSettings.asset

@@ -37,7 +37,6 @@ GraphicsSettings:
   - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
   - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
   - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
-  - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
   m_PreloadedShaders: []
   m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
     type: 0}