Просмотр исходного кода

ecsview还有点问题,先还原了

tanghai 7 лет назад
Родитель
Сommit
c12cbf17a1

+ 13 - 4
Unity/Assets/Scenes/Init.unity

@@ -88,6 +88,7 @@ LightmapSettings:
     m_PVRFilteringAtrousPositionSigmaDirect: 0.5
     m_PVRFilteringAtrousPositionSigmaIndirect: 2
     m_PVRFilteringAtrousPositionSigmaAO: 1
+    m_ShowResolutionOverlay: 1
   m_LightingDataAsset: {fileID: 0}
   m_UseShadowmask: 0
 --- !u!196 &4
@@ -109,6 +110,8 @@ NavMeshSettings:
     manualTileSize: 0
     tileSize: 256
     accuratePlacement: 0
+    debug:
+      m_Flags: 0
   m_NavMeshData: {fileID: 0}
 --- !u!1 &29794235
 GameObject:
@@ -181,11 +184,11 @@ Camera:
   m_TargetEye: 3
   m_HDR: 0
   m_AllowMSAA: 1
+  m_AllowDynamicResolution: 0
   m_ForceIntoRT: 0
   m_OcclusionCulling: 1
   m_StereoConvergence: 10
   m_StereoSeparation: 0.022
-  m_StereoMirrorMode: 0
 --- !u!4 &29794240
 Transform:
   m_ObjectHideFlags: 0
@@ -329,6 +332,7 @@ MeshRenderer:
   m_Enabled: 1
   m_CastShadows: 1
   m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
   m_MotionVectors: 1
   m_LightProbeUsage: 1
   m_ReflectionProbeUsage: 1
@@ -344,6 +348,7 @@ MeshRenderer:
   m_PreserveUVs: 1
   m_IgnoreNormalsForChartDetection: 0
   m_ImportantGI: 0
+  m_StitchLightmapSeams: 0
   m_SelectedEditorRenderState: 3
   m_MinimumChartSize: 4
   m_AutoUVMaxDistance: 0.5
@@ -361,9 +366,9 @@ MeshCollider:
   m_Material: {fileID: 0}
   m_IsTrigger: 0
   m_Enabled: 1
-  serializedVersion: 2
+  serializedVersion: 3
   m_Convex: 0
-  m_InflateMesh: 0
+  m_CookingOptions: 14
   m_SkinWidth: 0.01
   m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
 --- !u!33 &497068781
@@ -472,6 +477,7 @@ MeshRenderer:
   m_Enabled: 1
   m_CastShadows: 1
   m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
   m_MotionVectors: 1
   m_LightProbeUsage: 1
   m_ReflectionProbeUsage: 1
@@ -487,6 +493,7 @@ MeshRenderer:
   m_PreserveUVs: 1
   m_IgnoreNormalsForChartDetection: 0
   m_ImportantGI: 0
+  m_StitchLightmapSeams: 0
   m_SelectedEditorRenderState: 3
   m_MinimumChartSize: 4
   m_AutoUVMaxDistance: 0.5
@@ -598,11 +605,11 @@ Camera:
   m_TargetEye: 3
   m_HDR: 0
   m_AllowMSAA: 1
+  m_AllowDynamicResolution: 0
   m_ForceIntoRT: 0
   m_OcclusionCulling: 1
   m_StereoConvergence: 10
   m_StereoSeparation: 0.022
-  m_StereoMirrorMode: 0
 --- !u!1 &1472883028
 GameObject:
   m_ObjectHideFlags: 0
@@ -720,6 +727,7 @@ MeshRenderer:
   m_Enabled: 1
   m_CastShadows: 1
   m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
   m_MotionVectors: 1
   m_LightProbeUsage: 1
   m_ReflectionProbeUsage: 1
@@ -735,6 +743,7 @@ MeshRenderer:
   m_PreserveUVs: 1
   m_IgnoreNormalsForChartDetection: 0
   m_ImportantGI: 0
+  m_StitchLightmapSeams: 0
   m_SelectedEditorRenderState: 3
   m_MinimumChartSize: 4
   m_AutoUVMaxDistance: 0.5

+ 9 - 38
Unity/Assets/Scripts/Base/Object/Component.cs

@@ -3,7 +3,7 @@ using MongoDB.Bson.Serialization.Attributes;
 
 namespace ETModel
 {
-    [BsonIgnoreExtraElements]
+	[BsonIgnoreExtraElements]
 	public abstract class Component : Object, IDisposable, IComponentSerialize
 	{
 		// 只有Game.EventSystem.Add方法中会设置该值,如果new出来的对象不想加入Game.EventSystem中,则需要自己在构造函数中设置
@@ -31,10 +31,7 @@ namespace ETModel
 
 				this.InstanceId = IdGenerater.GenerateId();
 				Game.EventSystem.Add(this);
-#if UNITY_EDITOR
-                ECSView.SetParent(this);
-#endif
-            }
+			}
 		}
 
 		[BsonIgnore]
@@ -45,23 +42,11 @@ namespace ETModel
 				return this.InstanceId == 0;
 			}
 		}
+		
+		[BsonIgnore]
+		public Component Parent { get; set; }
 
-        [BsonIgnore]
-        private Component parent;
-        [BsonIgnore]
-        public Component Parent
-        {
-            get { return parent; }
-            set
-            {
-                parent = value;
-#if UNITY_EDITOR
-                ECSView.SetParent(this, parent);
-#endif
-            }
-        }
-
-        public T GetParent<T>() where T : Component
+		public T GetParent<T>() where T : Component
 		{
 			return this.Parent as T;
 		}
@@ -77,9 +62,6 @@ namespace ETModel
 		
 		protected Component()
 		{
-#if UNITY_EDITOR
-            ECSView.CreateView(this);
-#endif
 		}
 
 		public virtual void Dispose()
@@ -95,25 +77,14 @@ namespace ETModel
 			Game.EventSystem.Remove(this.InstanceId);
 			
 			this.InstanceId = 0;
-#if UNITY_EDITOR
+
 			if (this.IsFromPool)
 			{
 				Game.ObjectPool.Recycle(this);
-                ECSView.ReturnPool(this);
 			}
-            else
-            {
-                ECSView.DestroyView(this);
-            }
-#else
-            if (this.IsFromPool)
-            {
-                Game.ObjectPool.Recycle(this);
-            }
-#endif
-        }
+		}
 
-        public virtual void BeginSerialize()
+		public virtual void BeginSerialize()
 		{
 		}
 

+ 25 - 47
Unity/Hotfix/Base/Object/Component.cs

@@ -31,9 +31,7 @@ namespace ETHotfix
 
 				this.InstanceId = IdGenerater.GenerateId();
 				Game.EventSystem.Add(this);
-                if (Define.IsEditorMode)
-                    ECSView.SetParent(this);
-            }
+			}
 		}
 
 		[BsonIgnore]
@@ -45,21 +43,10 @@ namespace ETHotfix
 			}
 		}
 
-        [BsonIgnore]
-        private Component parent;
-        [BsonIgnore]
-        public Component Parent
-        {
-            get { return parent; }
-            set
-            {
-                parent = value;
-                if (Define.IsEditorMode)
-                    ECSView.SetParent(this, parent);
-            }
-        }
+		[BsonIgnore]
+		public Component Parent { get; set; }
 
-        public T GetParent<T>() where T : Component
+		public T GetParent<T>() where T : Component
 		{
 			return this.Parent as T;
 		}
@@ -73,40 +60,31 @@ namespace ETHotfix
 			}
 		}
 
-        protected Component()
-        {
-            if (Define.IsEditorMode)
-                ECSView.CreateView(this);
-        }
-
-        public virtual void Dispose()
-        {
-            if (this.IsDisposed)
-            {
-                return;
-            }
-
-            // 触发Destroy事件
-            Game.EventSystem.Destroy(this);
-
-            Game.EventSystem.Remove(this.InstanceId);
-
-            this.InstanceId = 0;
+		protected Component()
+		{
+		}
+		
+		public virtual void Dispose()
+		{
+			if (this.IsDisposed)
+			{
+				return;
+			}
+			
+			// 触发Destroy事件
+			Game.EventSystem.Destroy(this);
 
-            if (this.IsFromPool)
-                Game.ObjectPool.Recycle(this);
+			Game.EventSystem.Remove(this.InstanceId);
 
-            if (Define.IsEditorMode)
-            {
-                if (this.IsFromPool)
-                    ECSView.ReturnPool(this);
-                else
-                    ECSView.DestroyView(this);
-            }
+			this.InstanceId = 0;
 
-        }
+			if (this.IsFromPool)
+			{
+				Game.ObjectPool.Recycle(this);
+			}
+		}
 
-        public virtual void BeginSerialize()
+		public virtual void BeginSerialize()
 		{
 		}
 

+ 5 - 7
Unity/Unity.csproj

@@ -12,16 +12,13 @@
     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
-    <TargetFrameworkProfile>
-    </TargetFrameworkProfile>
-    <CompilerResponseFile>
-    </CompilerResponseFile>
+    <TargetFrameworkProfile></TargetFrameworkProfile>
+    <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>Game:1</UnityProjectType>
     <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
     <UnityVersion>2017.4.9f1</UnityVersion>
-    <RootNamespace>
-    </RootNamespace>
+    <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup>
@@ -436,6 +433,7 @@
     <Compile Include="Assets\Scripts\Module\UI\UIType.cs" />
     <Compile Include="Assets\Scripts\Other\AppType.cs" />
     <Compile Include="Assets\Scripts\Other\Define.cs" />
+    <Compile Include="Assets\Scripts\Other\ECSView.cs" />
     <Compile Include="Assets\Scripts\Other\IInstanceMethod.cs" />
     <Compile Include="Assets\Scripts\Other\ILMethod.cs" />
     <Compile Include="Assets\Scripts\Other\MonoMethod.cs" />
@@ -1153,4 +1151,4 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>