com.elestrago.unity.entitas-redux 3.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/CHANGELOG.md +354 -0
  2. package/CHANGELOG.md.meta +7 -0
  3. package/Docs/EntitasReduxAPI.chm +0 -0
  4. package/Docs/EntitasReduxAPI.chm.meta +7 -0
  5. package/Docs/Images/portrait.png +0 -0
  6. package/Docs/Images/portrait.png.meta +91 -0
  7. package/Docs/Images/social_share_image.png +0 -0
  8. package/Docs/Images/social_share_image.png.meta +91 -0
  9. package/Docs/Images.meta +8 -0
  10. package/Docs.meta +8 -0
  11. package/LICENSE.md +21 -0
  12. package/LICENSE.md.meta +7 -0
  13. package/Licenses/LICENSE.txt +21 -0
  14. package/Licenses/LICENSE.txt.meta +7 -0
  15. package/Licenses/SCHMID_LICENSE.txt +22 -0
  16. package/Licenses/SCHMID_LICENSE.txt.meta +7 -0
  17. package/Licenses.meta +8 -0
  18. package/Plugins/EntitasRedux.Command.Generator.dll +0 -0
  19. package/Plugins/EntitasRedux.Command.Generator.dll.meta +89 -0
  20. package/Plugins/EntitasRedux.Core.Generator.dll +0 -0
  21. package/Plugins/EntitasRedux.Core.Generator.dll.meta +89 -0
  22. package/Plugins/EntitasRedux.Core.Libs.dll +0 -0
  23. package/Plugins/EntitasRedux.Core.Libs.dll.meta +75 -0
  24. package/Plugins/EntitasRedux.Core.dll +0 -0
  25. package/Plugins/EntitasRedux.Core.dll.meta +75 -0
  26. package/Plugins.meta +8 -0
  27. package/README.md +106 -0
  28. package/README.md.meta +7 -0
  29. package/Scripts/AssemblyInfo.cs +39 -0
  30. package/Scripts/AssemblyInfo.cs.meta +11 -0
  31. package/Scripts/Blueprints/AssemblyInfo.cs +39 -0
  32. package/Scripts/Blueprints/AssemblyInfo.cs.meta +11 -0
  33. package/Scripts/Blueprints/BlueprintBase.cs +66 -0
  34. package/Scripts/Blueprints/BlueprintBase.cs.meta +11 -0
  35. package/Scripts/Blueprints/BlueprintBehaviourBase.cs +63 -0
  36. package/Scripts/Blueprints/BlueprintBehaviourBase.cs.meta +11 -0
  37. package/Scripts/Blueprints/Editor/AssemblyInfo.cs +35 -0
  38. package/Scripts/Blueprints/Editor/AssemblyInfo.cs.meta +11 -0
  39. package/Scripts/Blueprints/Editor/BlueprintBaseInspector.cs +67 -0
  40. package/Scripts/Blueprints/Editor/BlueprintBaseInspector.cs.meta +11 -0
  41. package/Scripts/Blueprints/Editor/BlueprintBehaviourBaseInspector.cs +67 -0
  42. package/Scripts/Blueprints/Editor/BlueprintBehaviourBaseInspector.cs.meta +11 -0
  43. package/Scripts/Blueprints/Editor/BlueprintInspector.cs +268 -0
  44. package/Scripts/Blueprints/Editor/BlueprintInspector.cs.meta +11 -0
  45. package/Scripts/Blueprints/Editor/EntitasRedux.Blueprints.Editor.asmdef +20 -0
  46. package/Scripts/Blueprints/Editor/EntitasRedux.Blueprints.Editor.asmdef.meta +7 -0
  47. package/Scripts/Blueprints/Editor.meta +8 -0
  48. package/Scripts/Blueprints/EntitasRedux.Blueprints.asmdef +15 -0
  49. package/Scripts/Blueprints/EntitasRedux.Blueprints.asmdef.meta +7 -0
  50. package/Scripts/Blueprints.meta +8 -0
  51. package/Scripts/Core/Utils/UnsubscribeEvent.cs +20 -0
  52. package/Scripts/Core/Utils/UnsubscribeEvent.cs.meta +3 -0
  53. package/Scripts/Core/Utils/UnsubscribeEventExtensions.cs +13 -0
  54. package/Scripts/Core/Utils/UnsubscribeEventExtensions.cs.meta +3 -0
  55. package/Scripts/Core/Utils.meta +3 -0
  56. package/Scripts/Core/View/IEntityHashHolder.cs +7 -0
  57. package/Scripts/Core/View/IEntityHashHolder.cs.meta +3 -0
  58. package/Scripts/Core/View/ILinkable.cs +9 -0
  59. package/Scripts/Core/View/ILinkable.cs.meta +3 -0
  60. package/Scripts/Core/View/Impls/EntityHashHolder.cs +11 -0
  61. package/Scripts/Core/View/Impls/EntityHashHolder.cs.meta +3 -0
  62. package/Scripts/Core/View/Impls/LinkableView.Editor.cs +41 -0
  63. package/Scripts/Core/View/Impls/LinkableView.Editor.cs.meta +3 -0
  64. package/Scripts/Core/View/Impls/LinkableView.cs +99 -0
  65. package/Scripts/Core/View/Impls/LinkableView.cs.meta +3 -0
  66. package/Scripts/Core/View/Impls.meta +3 -0
  67. package/Scripts/Core/View.meta +3 -0
  68. package/Scripts/Core.meta +8 -0
  69. package/Scripts/Editor/AssemblyInfo.cs +39 -0
  70. package/Scripts/Editor/AssemblyInfo.cs.meta +11 -0
  71. package/Scripts/Editor/CreateScriptMenuItems.cs +89 -0
  72. package/Scripts/Editor/CreateScriptMenuItems.cs.meta +11 -0
  73. package/Scripts/Editor/EntitasRedux.Editor.asmdef +18 -0
  74. package/Scripts/Editor/EntitasRedux.Editor.asmdef.meta +7 -0
  75. package/Scripts/Editor/EntitasReduxStyles.cs +65 -0
  76. package/Scripts/Editor/EntitasReduxStyles.cs.meta +11 -0
  77. package/Scripts/Editor/Extensions/ColorExtensions.cs +50 -0
  78. package/Scripts/Editor/Extensions/ColorExtensions.cs.meta +11 -0
  79. package/Scripts/Editor/Extensions/PublicMemberInfoExtensions.cs +60 -0
  80. package/Scripts/Editor/Extensions/PublicMemberInfoExtensions.cs.meta +11 -0
  81. package/Scripts/Editor/Extensions/SerializationTypeExtensions.cs +124 -0
  82. package/Scripts/Editor/Extensions/SerializationTypeExtensions.cs.meta +11 -0
  83. package/Scripts/Editor/Extensions/StringExtensions.cs +141 -0
  84. package/Scripts/Editor/Extensions/StringExtensions.cs.meta +11 -0
  85. package/Scripts/Editor/Extensions/TypeExtensions.cs +216 -0
  86. package/Scripts/Editor/Extensions/TypeExtensions.cs.meta +11 -0
  87. package/Scripts/Editor/Extensions.meta +8 -0
  88. package/Scripts/Editor/Images/EntitasContextErrorHierarchyIcon.png +0 -0
  89. package/Scripts/Editor/Images/EntitasContextErrorHierarchyIcon.png.meta +93 -0
  90. package/Scripts/Editor/Images/EntitasContextHierarchyIcon.png +0 -0
  91. package/Scripts/Editor/Images/EntitasContextHierarchyIcon.png.meta +93 -0
  92. package/Scripts/Editor/Images/EntitasEntityErrorHierarchyIcon.png +0 -0
  93. package/Scripts/Editor/Images/EntitasEntityErrorHierarchyIcon.png.meta +93 -0
  94. package/Scripts/Editor/Images/EntitasEntityHierarchyIcon.png +0 -0
  95. package/Scripts/Editor/Images/EntitasEntityHierarchyIcon.png.meta +93 -0
  96. package/Scripts/Editor/Images/EntitasEntityLinkHierarchyIcon.png +0 -0
  97. package/Scripts/Editor/Images/EntitasEntityLinkHierarchyIcon.png.meta +93 -0
  98. package/Scripts/Editor/Images/EntitasEntityLinkWarnHierarchyIcon.png +0 -0
  99. package/Scripts/Editor/Images/EntitasEntityLinkWarnHierarchyIcon.png.meta +93 -0
  100. package/Scripts/Editor/Images/EntitasHeader.png +0 -0
  101. package/Scripts/Editor/Images/EntitasHeader.png.meta +93 -0
  102. package/Scripts/Editor/Images/EntitasSystemsHierarchyIcon.png +0 -0
  103. package/Scripts/Editor/Images/EntitasSystemsHierarchyIcon.png.meta +93 -0
  104. package/Scripts/Editor/Images/EntitasSystemsWarnHierarchyIcon.png +0 -0
  105. package/Scripts/Editor/Images/EntitasSystemsWarnHierarchyIcon.png.meta +93 -0
  106. package/Scripts/Editor/Images.meta +8 -0
  107. package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultArrayCreator.cs +43 -0
  108. package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultArrayCreator.cs.meta +11 -0
  109. package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultStringCreator.cs +42 -0
  110. package/Scripts/Editor/Inspector/DefaultInstanceCreator/DefaultStringCreator.cs.meta +11 -0
  111. package/Scripts/Editor/Inspector/DefaultInstanceCreator/IDefaultInstanceCreator.cs +36 -0
  112. package/Scripts/Editor/Inspector/DefaultInstanceCreator/IDefaultInstanceCreator.cs.meta +11 -0
  113. package/Scripts/Editor/Inspector/DefaultInstanceCreator.meta +8 -0
  114. package/Scripts/Editor/Inspector/Entity/EntityDrawer.cs +927 -0
  115. package/Scripts/Editor/Inspector/Entity/EntityDrawer.cs.meta +11 -0
  116. package/Scripts/Editor/Inspector/Entity/EntityInspector.cs +57 -0
  117. package/Scripts/Editor/Inspector/Entity/EntityInspector.cs.meta +11 -0
  118. package/Scripts/Editor/Inspector/Entity.meta +8 -0
  119. package/Scripts/Editor/Inspector/IComponentDrawer.cs +36 -0
  120. package/Scripts/Editor/Inspector/IComponentDrawer.cs.meta +11 -0
  121. package/Scripts/Editor/Inspector/TypeDrawer/AnimationCurveTypeDrawer.cs +44 -0
  122. package/Scripts/Editor/Inspector/TypeDrawer/AnimationCurveTypeDrawer.cs.meta +11 -0
  123. package/Scripts/Editor/Inspector/TypeDrawer/ArrayTypeDrawer.cs +282 -0
  124. package/Scripts/Editor/Inspector/TypeDrawer/ArrayTypeDrawer.cs.meta +11 -0
  125. package/Scripts/Editor/Inspector/TypeDrawer/BoolTypeDrawer.cs +43 -0
  126. package/Scripts/Editor/Inspector/TypeDrawer/BoolTypeDrawer.cs.meta +11 -0
  127. package/Scripts/Editor/Inspector/TypeDrawer/BoundsTypeDrawer.cs +44 -0
  128. package/Scripts/Editor/Inspector/TypeDrawer/BoundsTypeDrawer.cs.meta +11 -0
  129. package/Scripts/Editor/Inspector/TypeDrawer/CharTypeDrawer.cs +44 -0
  130. package/Scripts/Editor/Inspector/TypeDrawer/CharTypeDrawer.cs.meta +11 -0
  131. package/Scripts/Editor/Inspector/TypeDrawer/ColorTypeDrawer.cs +44 -0
  132. package/Scripts/Editor/Inspector/TypeDrawer/ColorTypeDrawer.cs.meta +11 -0
  133. package/Scripts/Editor/Inspector/TypeDrawer/DateTimeTypeDrawer.cs +49 -0
  134. package/Scripts/Editor/Inspector/TypeDrawer/DateTimeTypeDrawer.cs.meta +11 -0
  135. package/Scripts/Editor/Inspector/TypeDrawer/DictionaryTypeDrawer.cs +131 -0
  136. package/Scripts/Editor/Inspector/TypeDrawer/DictionaryTypeDrawer.cs.meta +11 -0
  137. package/Scripts/Editor/Inspector/TypeDrawer/DoubleTypeDrawer.cs +43 -0
  138. package/Scripts/Editor/Inspector/TypeDrawer/DoubleTypeDrawer.cs.meta +11 -0
  139. package/Scripts/Editor/Inspector/TypeDrawer/EnumTypeDrawer.cs +48 -0
  140. package/Scripts/Editor/Inspector/TypeDrawer/EnumTypeDrawer.cs.meta +11 -0
  141. package/Scripts/Editor/Inspector/TypeDrawer/FloatTypeDrawer.cs +43 -0
  142. package/Scripts/Editor/Inspector/TypeDrawer/FloatTypeDrawer.cs.meta +11 -0
  143. package/Scripts/Editor/Inspector/TypeDrawer/HashSetTypeDrawer.cs +124 -0
  144. package/Scripts/Editor/Inspector/TypeDrawer/HashSetTypeDrawer.cs.meta +11 -0
  145. package/Scripts/Editor/Inspector/TypeDrawer/ITypeDrawer.cs +36 -0
  146. package/Scripts/Editor/Inspector/TypeDrawer/ITypeDrawer.cs.meta +11 -0
  147. package/Scripts/Editor/Inspector/TypeDrawer/IntTypeDrawer.cs +43 -0
  148. package/Scripts/Editor/Inspector/TypeDrawer/IntTypeDrawer.cs.meta +11 -0
  149. package/Scripts/Editor/Inspector/TypeDrawer/ListTypeDrawer.cs +163 -0
  150. package/Scripts/Editor/Inspector/TypeDrawer/ListTypeDrawer.cs.meta +11 -0
  151. package/Scripts/Editor/Inspector/TypeDrawer/RectTypeDrawer.cs +44 -0
  152. package/Scripts/Editor/Inspector/TypeDrawer/RectTypeDrawer.cs.meta +11 -0
  153. package/Scripts/Editor/Inspector/TypeDrawer/StringTypeDrawer.cs +43 -0
  154. package/Scripts/Editor/Inspector/TypeDrawer/StringTypeDrawer.cs.meta +11 -0
  155. package/Scripts/Editor/Inspector/TypeDrawer/UnityObjectTypeDrawer.cs +49 -0
  156. package/Scripts/Editor/Inspector/TypeDrawer/UnityObjectTypeDrawer.cs.meta +11 -0
  157. package/Scripts/Editor/Inspector/TypeDrawer/Vector2TypeDrawer.cs +44 -0
  158. package/Scripts/Editor/Inspector/TypeDrawer/Vector2TypeDrawer.cs.meta +11 -0
  159. package/Scripts/Editor/Inspector/TypeDrawer/Vector3TypeDrawer.cs +44 -0
  160. package/Scripts/Editor/Inspector/TypeDrawer/Vector3TypeDrawer.cs.meta +11 -0
  161. package/Scripts/Editor/Inspector/TypeDrawer/Vector4TypeDrawer.cs +44 -0
  162. package/Scripts/Editor/Inspector/TypeDrawer/Vector4TypeDrawer.cs.meta +11 -0
  163. package/Scripts/Editor/Inspector/TypeDrawer.meta +8 -0
  164. package/Scripts/Editor/Inspector.meta +8 -0
  165. package/Scripts/Editor/MenuItems.cs +84 -0
  166. package/Scripts/Editor/MenuItems.cs.meta +11 -0
  167. package/Scripts/Editor/PlayModeHelper.cs +75 -0
  168. package/Scripts/Editor/PlayModeHelper.cs.meta +11 -0
  169. package/Scripts/Editor/Reflection/AttributeInfo.cs +44 -0
  170. package/Scripts/Editor/Reflection/AttributeInfo.cs.meta +11 -0
  171. package/Scripts/Editor/Reflection/PublicMemberInfo.cs +95 -0
  172. package/Scripts/Editor/Reflection/PublicMemberInfo.cs.meta +11 -0
  173. package/Scripts/Editor/Reflection.meta +8 -0
  174. package/Scripts/Editor/ScriptTemplates/CleanupSystem.txt +15 -0
  175. package/Scripts/Editor/ScriptTemplates/CleanupSystem.txt.meta +7 -0
  176. package/Scripts/Editor/ScriptTemplates/Component.txt +9 -0
  177. package/Scripts/Editor/ScriptTemplates/Component.txt.meta +7 -0
  178. package/Scripts/Editor/ScriptTemplates/FixedUpdateSystem.txt +15 -0
  179. package/Scripts/Editor/ScriptTemplates/FixedUpdateSystem.txt.meta +7 -0
  180. package/Scripts/Editor/ScriptTemplates/InitializeSystem.txt +15 -0
  181. package/Scripts/Editor/ScriptTemplates/InitializeSystem.txt.meta +7 -0
  182. package/Scripts/Editor/ScriptTemplates/LateUpdateSystem.txt +15 -0
  183. package/Scripts/Editor/ScriptTemplates/LateUpdateSystem.txt.meta +7 -0
  184. package/Scripts/Editor/ScriptTemplates/ReactiveSystem.txt +39 -0
  185. package/Scripts/Editor/ScriptTemplates/ReactiveSystem.txt.meta +7 -0
  186. package/Scripts/Editor/ScriptTemplates/UpdateSystem.txt +15 -0
  187. package/Scripts/Editor/ScriptTemplates/UpdateSystem.txt.meta +7 -0
  188. package/Scripts/Editor/ScriptTemplates.meta +8 -0
  189. package/Scripts/Editor/Tools/ColorTools.cs +59 -0
  190. package/Scripts/Editor/Tools/ColorTools.cs.meta +11 -0
  191. package/Scripts/Editor/Tools/EditorGUILayoutTools.cs +242 -0
  192. package/Scripts/Editor/Tools/EditorGUILayoutTools.cs.meta +11 -0
  193. package/Scripts/Editor/Tools/PlayerSettingsTools.cs +144 -0
  194. package/Scripts/Editor/Tools/PlayerSettingsTools.cs.meta +11 -0
  195. package/Scripts/Editor/Tools/PreferenceTools.cs +116 -0
  196. package/Scripts/Editor/Tools/PreferenceTools.cs.meta +11 -0
  197. package/Scripts/Editor/Tools/RefactorModeTools.cs +85 -0
  198. package/Scripts/Editor/Tools/RefactorModeTools.cs.meta +11 -0
  199. package/Scripts/Editor/Tools/ReflectionTools.cs +33 -0
  200. package/Scripts/Editor/Tools/ReflectionTools.cs.meta +3 -0
  201. package/Scripts/Editor/Tools/ScriptTools.cs +117 -0
  202. package/Scripts/Editor/Tools/ScriptTools.cs.meta +11 -0
  203. package/Scripts/Editor/Tools/SerializationTools.cs +91 -0
  204. package/Scripts/Editor/Tools/SerializationTools.cs.meta +11 -0
  205. package/Scripts/Editor/Tools.meta +8 -0
  206. package/Scripts/Editor/Window/AboutWindow.cs +153 -0
  207. package/Scripts/Editor/Window/AboutWindow.cs.meta +14 -0
  208. package/Scripts/Editor/Window.meta +8 -0
  209. package/Scripts/Editor.meta +8 -0
  210. package/Scripts/EntitasRedux.asmdef +13 -0
  211. package/Scripts/EntitasRedux.asmdef.meta +7 -0
  212. package/Scripts/Entity/EntityBehaviour.cs +82 -0
  213. package/Scripts/Entity/EntityBehaviour.cs.meta +11 -0
  214. package/Scripts/Entity.meta +8 -0
  215. package/Scripts/EntityLink.cs +85 -0
  216. package/Scripts/EntityLink.cs.meta +11 -0
  217. package/Scripts/Extensions/EntityLinkExtension.cs +52 -0
  218. package/Scripts/Extensions/EntityLinkExtension.cs.meta +11 -0
  219. package/Scripts/Extensions.meta +8 -0
  220. package/Scripts/VersionConstants.cs +58 -0
  221. package/Scripts/VersionConstants.cs.meta +11 -0
  222. package/Scripts/VisualDebugging/AssemblyInfo.cs +39 -0
  223. package/Scripts/VisualDebugging/AssemblyInfo.cs.meta +11 -0
  224. package/Scripts/VisualDebugging/ContextObserver/ContextObserver.cs +107 -0
  225. package/Scripts/VisualDebugging/ContextObserver/ContextObserver.cs.meta +11 -0
  226. package/Scripts/VisualDebugging/ContextObserver/ContextObserverBehaviour.cs +60 -0
  227. package/Scripts/VisualDebugging/ContextObserver/ContextObserverBehaviour.cs.meta +11 -0
  228. package/Scripts/VisualDebugging/ContextObserver/ContextObserverExtension.cs +47 -0
  229. package/Scripts/VisualDebugging/ContextObserver/ContextObserverExtension.cs.meta +11 -0
  230. package/Scripts/VisualDebugging/ContextObserver.meta +8 -0
  231. package/Scripts/VisualDebugging/DebugSystems/AvgResetInterval.cs +37 -0
  232. package/Scripts/VisualDebugging/DebugSystems/AvgResetInterval.cs.meta +11 -0
  233. package/Scripts/VisualDebugging/DebugSystems/DebugSystems.cs +477 -0
  234. package/Scripts/VisualDebugging/DebugSystems/DebugSystems.cs.meta +11 -0
  235. package/Scripts/VisualDebugging/DebugSystems/DebugSystemsBehaviour.cs +41 -0
  236. package/Scripts/VisualDebugging/DebugSystems/DebugSystemsBehaviour.cs.meta +11 -0
  237. package/Scripts/VisualDebugging/DebugSystems/SystemInfo.cs +347 -0
  238. package/Scripts/VisualDebugging/DebugSystems/SystemInfo.cs.meta +11 -0
  239. package/Scripts/VisualDebugging/DebugSystems.meta +8 -0
  240. package/Scripts/VisualDebugging/Editor/AssemblyInfo.cs +35 -0
  241. package/Scripts/VisualDebugging/Editor/AssemblyInfo.cs.meta +11 -0
  242. package/Scripts/VisualDebugging/Editor/ContextObserver/ContextObserverInspector.cs +104 -0
  243. package/Scripts/VisualDebugging/Editor/ContextObserver/ContextObserverInspector.cs.meta +11 -0
  244. package/Scripts/VisualDebugging/Editor/ContextObserver.meta +8 -0
  245. package/Scripts/VisualDebugging/Editor/DebugSystems/DebugSystemsBehaviourInspector.cs +709 -0
  246. package/Scripts/VisualDebugging/Editor/DebugSystems/DebugSystemsBehaviourInspector.cs.meta +11 -0
  247. package/Scripts/VisualDebugging/Editor/DebugSystems.meta +8 -0
  248. package/Scripts/VisualDebugging/Editor/EntitasHierarchyIcon.cs +226 -0
  249. package/Scripts/VisualDebugging/Editor/EntitasHierarchyIcon.cs.meta +11 -0
  250. package/Scripts/VisualDebugging/Editor/EntitasRedux.VisualDebugging.Editor.asmdef +21 -0
  251. package/Scripts/VisualDebugging/Editor/EntitasRedux.VisualDebugging.Editor.asmdef.meta +7 -0
  252. package/Scripts/VisualDebugging/Editor/EntitasStats.cs +131 -0
  253. package/Scripts/VisualDebugging/Editor/EntitasStats.cs.meta +11 -0
  254. package/Scripts/VisualDebugging/Editor/EntityLinkInspector.cs +71 -0
  255. package/Scripts/VisualDebugging/Editor/EntityLinkInspector.cs.meta +11 -0
  256. package/Scripts/VisualDebugging/Editor/Graph.cs +234 -0
  257. package/Scripts/VisualDebugging/Editor/Graph.cs.meta +11 -0
  258. package/Scripts/VisualDebugging/Editor/VisualDebugStyles.cs +55 -0
  259. package/Scripts/VisualDebugging/Editor/VisualDebugStyles.cs.meta +11 -0
  260. package/Scripts/VisualDebugging/Editor/VisualDebuggingEntitasExtension.cs +35 -0
  261. package/Scripts/VisualDebugging/Editor/VisualDebuggingEntitasExtension.cs.meta +11 -0
  262. package/Scripts/VisualDebugging/Editor/VisualDebuggingPreferences.cs +188 -0
  263. package/Scripts/VisualDebugging/Editor/VisualDebuggingPreferences.cs.meta +11 -0
  264. package/Scripts/VisualDebugging/Editor.meta +8 -0
  265. package/Scripts/VisualDebugging/EntitasRedux.VisualDebugging.asmdef +18 -0
  266. package/Scripts/VisualDebugging/EntitasRedux.VisualDebugging.asmdef.meta +7 -0
  267. package/Scripts/VisualDebugging/Extensions/GameObjectDestroyExtensions.cs +44 -0
  268. package/Scripts/VisualDebugging/Extensions/GameObjectDestroyExtensions.cs.meta +11 -0
  269. package/Scripts/VisualDebugging/Extensions.meta +8 -0
  270. package/Scripts/VisualDebugging.meta +8 -0
  271. package/Scripts.meta +8 -0
  272. package/package.json +30 -0
  273. package/package.json.meta +7 -0
@@ -0,0 +1,41 @@
1
+ #if UNITY_EDITOR
2
+ using UnityEditor;
3
+
4
+ namespace JCMG.EntitasRedux.Core.View.Impls
5
+ {
6
+ public abstract partial class LinkableView
7
+ {
8
+ private void OnValidate()
9
+ {
10
+ EditorApplication.delayCall += _OnValidate;
11
+ }
12
+
13
+ private void _OnValidate()
14
+ {
15
+ if (this == null)
16
+ {
17
+ EditorApplication.delayCall -= _OnValidate;
18
+ return; // MissingRefException if managed in the editor - uses the overloaded Unity == operator.
19
+ }
20
+
21
+ OnValidateCallback();
22
+ }
23
+
24
+ protected virtual void OnValidateCallback()
25
+ {
26
+ EditorAttackEntityLink();
27
+ }
28
+
29
+ private void EditorAttackEntityLink()
30
+ {
31
+ var component = GetComponent<EntityLink>();
32
+ if (entityLink == component)
33
+ return;
34
+
35
+ var serializedObject = new SerializedObject(this);
36
+ serializedObject.FindProperty(nameof(entityLink)).objectReferenceValue = component;
37
+ serializedObject.ApplyModifiedProperties();
38
+ }
39
+ }
40
+ }
41
+ #endif
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 8deee76aaafb497da1626492365f0c07
3
+ timeCreated: 1692379565
@@ -0,0 +1,99 @@
1
+ using JCMG.EntitasRedux.Core.Utils;
2
+ using UnityEngine;
3
+
4
+ namespace JCMG.EntitasRedux.Core.View.Impls
5
+ {
6
+ public abstract class LinkableView<TEntity> : LinkableView
7
+ where TEntity : class, IEntity
8
+ {
9
+ protected sealed override void Subscribe(IEntity entity, IUnsubscribeEvent unsubscribe)
10
+ => Subscribe(entity as TEntity, unsubscribe);
11
+
12
+ protected virtual void Subscribe(TEntity entity, IUnsubscribeEvent unsubscribe)
13
+ {
14
+ }
15
+ }
16
+
17
+ [RequireComponent(typeof(EntityLink))]
18
+ public abstract partial class LinkableView : MonoBehaviour, ILinkable
19
+ {
20
+ private readonly UnsubscribeEvent _unsubscribeEvent = new();
21
+
22
+ [SerializeField] protected EntityLink entityLink;
23
+
24
+ private bool _destroyed;
25
+
26
+ public int Hash => transform.GetHashCode();
27
+
28
+ public void Link(IEntity entity)
29
+ {
30
+ if (entityLink == null)
31
+ {
32
+ if (!TryGetComponent(out entityLink))
33
+ {
34
+ Debug.LogError($"[{nameof(LinkableView)}] Cannot get {nameof(EntityLink)} component.", this);
35
+ return;
36
+ }
37
+ }
38
+
39
+ if (!entityLink.Link(entity))
40
+ return;
41
+
42
+ entity.OnBeforeDestroyEntity += OnDestroyEntity;
43
+ Subscribe(entity, _unsubscribeEvent);
44
+ }
45
+
46
+ public void Unlink()
47
+ {
48
+ var entity = entityLink.Entity;
49
+ if (entity == null)
50
+ return;
51
+
52
+ OnDestroyEntity(entity);
53
+ }
54
+
55
+ private void OnDestroyEntity(IEntity entity)
56
+ {
57
+ entityLink.Unlink();
58
+
59
+ if (entity.IsEnabled)
60
+ {
61
+ entity.OnBeforeDestroyEntity -= OnDestroyEntity;
62
+ Unsubscribe();
63
+ }
64
+
65
+ if (!_destroyed)
66
+ OnClear();
67
+ }
68
+
69
+ protected abstract void Subscribe(IEntity entity, IUnsubscribeEvent unsubscribe);
70
+
71
+ private void Unsubscribe()
72
+ {
73
+ _unsubscribeEvent.Clear();
74
+ OnUnsubscribe();
75
+ }
76
+
77
+ protected virtual void OnUnsubscribe()
78
+ {
79
+ }
80
+
81
+ protected virtual void OnClear()
82
+ {
83
+ }
84
+
85
+ private void OnDestroy()
86
+ {
87
+ _destroyed = true;
88
+ var entity = entityLink.Entity;
89
+ if (entity != null)
90
+ OnDestroyEntity(entity);
91
+
92
+ OnDestroyed();
93
+ }
94
+
95
+ protected virtual void OnDestroyed()
96
+ {
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 485facd232614114b1e2a0cc6f4e65fb
3
+ timeCreated: 1678266564
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 770cd195d28348c5b73170ceb0daebd5
3
+ timeCreated: 1678266097
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: a7f6cce6d60241cb888c8c8012b51a01
3
+ timeCreated: 1678265902
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: bcec10d24ea064f479ec7a1466e8f28e
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,39 @@
1
+ /*
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2020 Jeff Campbell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ using System.Reflection;
27
+ using System.Runtime.CompilerServices;
28
+
29
+ [assembly: InternalsVisibleTo("EntitasRedux.Migration.Editor")]
30
+ [assembly: InternalsVisibleTo("EntitasRedux.Blueprints.Editor")]
31
+
32
+ [assembly: AssemblyCompany("Jeff Campbell")]
33
+ [assembly: AssemblyFileVersion("2.1.0")]
34
+ [assembly: AssemblyInformationalVersion("2.1.0+7.Branch.develop.Sha.21ee36e5c2bfc83d5c03aa0da164adbc40f7b20e")]
35
+ [assembly: AssemblyProduct("EntitasRedux.Editor")]
36
+ [assembly: AssemblyTitle("EntitasRedux.Editor")]
37
+ [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/jeffcampbellmakesgames/Entitas-Redux.git")]
38
+
39
+ [assembly: AssemblyVersion("2.1.0")]
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: ae5fbc698e85aa447a3476a7c1b989f5
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,89 @@
1
+ /*
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2020 Jeff Campbell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ using UnityEditor;
27
+
28
+ namespace JCMG.EntitasRedux.Editor
29
+ {
30
+ /// <summary>
31
+ /// Menu items for creating C# scripts for EntitasRedux
32
+ /// </summary>
33
+ internal static class CreateScriptMenuItems
34
+ {
35
+ private const string SCRIPT_TEMPLATE_FOLDER_GUID = "5a15a764f3e073b4cbdd6195a11a98ec";
36
+
37
+ public const string COMPONENT_FILE_NAME = "Component.txt";
38
+ public const string INITIALIZE_SYSTEM_FILE_NAME = "InitializeSystem.txt";
39
+ public const string FIXED_UPDATE_SYSTEM_FILE_NAME = "FixedUpdateSystem.txt";
40
+ public const string UPDATE_SYSTEM_FILE_NAME = "UpdateSystem.txt";
41
+ public const string LATE_UPDATE_SYSTEM_FILE_NAME = "LateUpdateSystem.txt";
42
+ public const string REACTIVE_SYSTEM_FILE_NAME = "ReactiveSystem.txt";
43
+ public const string CLEANUP_SYSTEM_FILE_NAME = "CleanupSystem.txt";
44
+
45
+ private const string MENU_ITEM_PREFIX = "Assets/Create/EntitasRedux/";
46
+
47
+ [MenuItem(MENU_ITEM_PREFIX + "Component")]
48
+ private static void CreateEntitasComponent()
49
+ {
50
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, COMPONENT_FILE_NAME);
51
+ }
52
+
53
+ [MenuItem(MENU_ITEM_PREFIX + "InitializeSystem")]
54
+ private static void CreateEntitasInitializeSystem()
55
+ {
56
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, INITIALIZE_SYSTEM_FILE_NAME);
57
+ }
58
+
59
+ [MenuItem(MENU_ITEM_PREFIX + "FixedUpdateSystem")]
60
+ private static void CreateEntitasFixedUpdateSystem()
61
+ {
62
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, FIXED_UPDATE_SYSTEM_FILE_NAME);
63
+ }
64
+
65
+ [MenuItem(MENU_ITEM_PREFIX + "UpdateSystem")]
66
+ private static void CreateEntitasUpdateSystem()
67
+ {
68
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, UPDATE_SYSTEM_FILE_NAME);
69
+ }
70
+
71
+ [MenuItem(MENU_ITEM_PREFIX + "LateUpdateSystem")]
72
+ private static void CreateEntitasLateUpdateSystem()
73
+ {
74
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, LATE_UPDATE_SYSTEM_FILE_NAME);
75
+ }
76
+
77
+ [MenuItem(MENU_ITEM_PREFIX + "ReactiveSystem")]
78
+ private static void CreateEntitasReactiveSystem()
79
+ {
80
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, REACTIVE_SYSTEM_FILE_NAME);
81
+ }
82
+
83
+ [MenuItem(MENU_ITEM_PREFIX + "CleanupSystem")]
84
+ private static void CreateEntitasCleanupSystem()
85
+ {
86
+ ScriptTools.CreateScriptAsset(SCRIPT_TEMPLATE_FOLDER_GUID, CLEANUP_SYSTEM_FILE_NAME);
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 05c4af8898117c24483a2d3b4e215f56
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "EntitasRedux.Editor",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "GUID:53bc2da9556d30547913e5a8aa819794"
6
+ ],
7
+ "includePlatforms": [
8
+ "Editor"
9
+ ],
10
+ "excludePlatforms": [],
11
+ "allowUnsafeCode": false,
12
+ "overrideReferences": false,
13
+ "precompiledReferences": [],
14
+ "autoReferenced": true,
15
+ "defineConstraints": [],
16
+ "versionDefines": [],
17
+ "noEngineReferences": false
18
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 4f86ea35524e99d4fb2177e6a10dfbff
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,65 @@
1
+ /*
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2020 Jeff Campbell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ using UnityEngine;
27
+
28
+ namespace JCMG.EntitasRedux.Editor
29
+ {
30
+ public static class EntitasReduxStyles
31
+ {
32
+ public const string GROUP_BOX_STYLE = "GroupBox";
33
+
34
+ public static GUIStyle SectionHeader
35
+ {
36
+ get
37
+ {
38
+ if (_SECTION_HEADER == null)
39
+ {
40
+ _SECTION_HEADER = new GUIStyle("OL Title");
41
+ _SECTION_HEADER.fontStyle = FontStyle.Bold;
42
+ }
43
+
44
+ return _SECTION_HEADER;
45
+ }
46
+ }
47
+
48
+ public static GUIStyle SectionContent
49
+ {
50
+ get
51
+ {
52
+ if (_SECTION_CONTENT == null)
53
+ {
54
+ _SECTION_CONTENT = new GUIStyle("OL Box");
55
+ _SECTION_CONTENT.stretchHeight = false;
56
+ }
57
+
58
+ return _SECTION_CONTENT;
59
+ }
60
+ }
61
+
62
+ private static GUIStyle _SECTION_HEADER;
63
+ private static GUIStyle _SECTION_CONTENT;
64
+ }
65
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 6e8ae2bebaac301408d90ddfb79a4aa1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,50 @@
1
+ /*
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2020 Jeff Campbell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ using UnityEngine;
27
+
28
+ namespace JCMG.EntitasRedux.Editor
29
+ {
30
+ /// <summary>
31
+ /// Extension methods for <see cref="Color"/>.
32
+ /// </summary>
33
+ public static class ColorExtensions
34
+ {
35
+ private const string HEX_COLOR_RGBA_FORMAT = "{0:X2}{1:X2}{2:X2}{3:X2}";
36
+
37
+ /// <summary>
38
+ /// Returns the hex value of this color.
39
+ /// </summary>
40
+ public static string ToHexWithAlpha(this Color c)
41
+ {
42
+ return string.Format(
43
+ HEX_COLOR_RGBA_FORMAT,
44
+ (int)(c.r * 255f),
45
+ (int)(c.g * 255f),
46
+ (int)(c.b * 255f),
47
+ (int)(c.a * 255f));
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 5a7f52cefaa7d2c4e82e585c00be4b90
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,60 @@
1
+ /*
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2020 Jeff Campbell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ using System;
27
+
28
+ namespace JCMG.EntitasRedux.Editor
29
+ {
30
+ /// <summary>
31
+ /// Extension methods for <see cref="PublicMemberInfo"/>
32
+ /// </summary>
33
+ public static class PublicMemberInfoExtensions
34
+ {
35
+ public static object PublicMemberClone(this object obj)
36
+ {
37
+ var instance = Activator.CreateInstance(obj.GetType());
38
+ obj.CopyPublicMemberValues(instance);
39
+ return instance;
40
+ }
41
+
42
+ public static T PublicMemberClone<T>(this object obj)
43
+ where T : new()
44
+ {
45
+ var obj1 = new T();
46
+ obj.CopyPublicMemberValues(obj1);
47
+ return obj1;
48
+ }
49
+
50
+ public static void CopyPublicMemberValues(this object source, object target)
51
+ {
52
+ var publicMemberInfos = source.GetType().GetPublicMemberInfos();
53
+ for (var index = 0; index < publicMemberInfos.Count; ++index)
54
+ {
55
+ var publicMemberInfo = publicMemberInfos[index];
56
+ publicMemberInfo.SetValue(target, publicMemberInfo.GetValue(source));
57
+ }
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: cca1ea3868b188741919ecec0fc655fa
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,124 @@
1
+ /*
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2020 Jeff Campbell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ using System;
27
+ using System.Linq;
28
+ using System.Text.RegularExpressions;
29
+
30
+ namespace JCMG.EntitasRedux.Editor
31
+ {
32
+ public static class SerializationTypeExtensions
33
+ {
34
+ public static string ToCompilableString(this Type type)
35
+ {
36
+ if (SerializationTools.TryGetBuiltInTypeToString(type, out var str))
37
+ {
38
+ return str;
39
+ }
40
+ else if (type.IsGenericType)
41
+ {
42
+ return type.FullName.Split('`')[0] +
43
+ "<" +
44
+ string.Join(", ", type.GetGenericArguments().Select(argType => argType.ToCompilableString()).ToArray()) +
45
+ ">";
46
+ }
47
+ else if (type.IsArray)
48
+ {
49
+ return type.GetElementType().ToCompilableString() + "[" + new string(',', type.GetArrayRank() - 1) + "]";
50
+ }
51
+
52
+ return type.IsNested ? type.FullName.Replace('+', '.') : type.FullName;
53
+ }
54
+
55
+ public static Type ToType(this string typeString)
56
+ {
57
+ var typeString1 = GenerateTypeString(typeString);
58
+ var type1 = Type.GetType(typeString1);
59
+ if (type1 != null)
60
+ {
61
+ return type1;
62
+ }
63
+
64
+ foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
65
+ {
66
+ var type2 = assembly.GetType(typeString1);
67
+ if (type2 != null)
68
+ {
69
+ return type2;
70
+ }
71
+ }
72
+
73
+ return null;
74
+ }
75
+
76
+ public static string ShortTypeName(this string fullTypeName)
77
+ {
78
+ var strArray = fullTypeName.Split('.');
79
+ return strArray.Last();
80
+ }
81
+
82
+ public static string RemoveDots(this string fullTypeName)
83
+ {
84
+ return fullTypeName.Replace(".", string.Empty);
85
+ }
86
+
87
+ private static string GenerateTypeString(string typeString)
88
+ {
89
+ if (SerializationTools.TryGetBuiltInTypeToString(typeString, out var str) ||
90
+ SerializationTools.TryGetBuiltInTypeString(typeString, out str))
91
+ {
92
+ return str;
93
+ }
94
+
95
+ typeString = GenerateGenericArguments(typeString);
96
+ typeString = GenerateArray(typeString);
97
+
98
+ return typeString;
99
+ }
100
+
101
+ private static string GenerateGenericArguments(string typeString)
102
+ {
103
+ var separator = new[] { ", " };
104
+ typeString = Regex.Replace(
105
+ typeString,
106
+ "<(?<arg>.*)>",
107
+ m =>
108
+ {
109
+ var typeString1 = GenerateTypeString(m.Groups["arg"].Value);
110
+ return $"`{typeString1.Split(separator, StringSplitOptions.None).Length}[{typeString1}]";
111
+ });
112
+ return typeString;
113
+ }
114
+
115
+ private static string GenerateArray(string typeString)
116
+ {
117
+ typeString = Regex.Replace(
118
+ typeString,
119
+ "(?<type>[^\\[]*)(?<rank>\\[,*\\])",
120
+ m => GenerateTypeString(m.Groups["type"].Value) + m.Groups["rank"].Value);
121
+ return typeString;
122
+ }
123
+ }
124
+ }