Quellcode durchsuchen

feat:增加IContext接口

chenbin vor 2 Tagen
Ursprung
Commit
5c45215ce0

+ 12 - 0
Assets/Scripts/Framework/Runtime/IContext.cs

@@ -0,0 +1,12 @@
+using XGame.Framework.UI;
+
+namespace XGame.Framework
+{
+    /// <summary>
+    /// 上下文接口
+    /// </summary>
+    public interface IContext
+    {
+        IUIModule UI { get; }
+    }
+}

+ 11 - 0
Assets/Scripts/Framework/Runtime/IContext.cs.meta

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

+ 1 - 1
Assets/Scripts/Framework/Runtime/Map/MapContext.cs

@@ -5,7 +5,7 @@ using XGame.Framework.UI;
 
 namespace XGame.Framework.Map
 {
-    public sealed class MapContext : IDisposable
+    public sealed class MapContext : IContext, IDisposable
     {
         public IQualityModule Quality { get; private set; }
 

+ 1 - 1
Assets/Scripts/Framework/Runtime/Nodes/NodeContext.cs

@@ -10,7 +10,7 @@ namespace XGame.Framework.Nodes
     /// <summary>
     /// 每个NodeGroup一个Context
     /// </summary>
-    public sealed class NodeContext : IDisposable, INodeTreeSetter
+    public sealed class NodeContext : IContext, IDisposable, INodeTreeSetter
     {
         public IQualityModule Quality { get; private set; }
         private ITimeModule _timeModule;

+ 1 - 1
Assets/Scripts/Framework/Runtime/UI/UIContext.cs

@@ -7,7 +7,7 @@ namespace XGame.Framework.UI
     /// <summary>
     /// 每个UIView一个UIContext实例
     /// </summary>
-    public sealed class UIContext : IUIViewAdapter, IDisposable
+    public sealed class UIContext : IContext, IUIViewAdapter, IDisposable
     {
         public IQualityModule Quality { get; private set; }