Skip to content

Commit 3b6af94

Browse files
committed
v1.3.4
## Summary This release contains two small bug fixes. **Note:** If you install EntitasRedux using a `.UnityPackage` you must also grab the latest release of Genesis as well from [here](https://github.com/jeffcampbellmakesgames/Genesis) as it is not included. For better dependency handling, I would recommend using OpenUPM instead. ## ADDED * NA ## CHANGED * NA ## FIXED * Resolved code-generation compiler error for empty context with zero components where CopyTo, CopyComponentTo methods would not be present. * Resolved build-time compile error for missing member `Contexts.SharedInstance` ## REMOVED * NA
1 parent 3a6b642 commit 3b6af94

File tree

5 files changed

+21
-28
lines changed

5 files changed

+21
-28
lines changed

Docs/EntitasReduxAPI.chm

-990 Bytes
Binary file not shown.

Scripts/Editor/Plugins/Component/CodeGenerators/ComponentEntityApiGenerator.cs

+14-20
Original file line numberDiff line numberDiff line change
@@ -241,40 +241,34 @@ public void CopyTo(${ContextName}Entity copyToEntity, bool replaceExisting, para
241241

242242
public override CodeGenFile[] Generate(CodeGeneratorData[] data)
243243
{
244+
var contextData = data.OfType<ContextData>().Select(x => x.GetContextName());
244245
var methodComponentData = data
245246
.OfType<ComponentData>()
246247
.Where(d => d.ShouldGenerateMethods())
247248
.ToArray();
248249

249-
var contextNameToComponentData = methodComponentData
250-
.Aggregate(
251-
new Dictionary<string, List<ComponentData>>(),
252-
(dict, d) =>
250+
var codeGenFileList = new List<CodeGenFile>();
251+
foreach (var cd in contextData)
252+
{
253+
var componentData = new List<ComponentData>();
254+
for (var i = 0; i < methodComponentData.Length; i++)
255+
{
256+
if (!methodComponentData[i].GetContextNames().Contains(cd))
253257
{
254-
var contextNames = d.GetContextNames();
255-
foreach (var contextName in contextNames)
256-
{
257-
if (!dict.ContainsKey(contextName))
258-
{
259-
dict.Add(contextName, new List<ComponentData>());
260-
}
258+
continue;
259+
}
261260

262-
dict[contextName].Add(d);
263-
}
261+
componentData.Add(methodComponentData[i]);
262+
}
264263

265-
return dict;
266-
});
264+
codeGenFileList.Add(GenerateCopyMethodsFile(cd, componentData));
265+
}
267266

268-
var codeGenFileList = new List<CodeGenFile>();
269267
var componentSpecificCodeGenFiles = methodComponentData
270268
.SelectMany(Generate)
271269
.ToArray();
272270

273-
var copyComponentToCodeGenFiles = contextNameToComponentData
274-
.Select(kvp => GenerateCopyMethodsFile(kvp.Key, kvp.Value));
275-
276271
codeGenFileList.AddRange(componentSpecificCodeGenFiles);
277-
codeGenFileList.AddRange(copyComponentToCodeGenFiles);
278272

279273
return codeGenFileList.ToArray();
280274
}

Scripts/Editor/Plugins/Context/CodeGenerators/ContextsGenerator.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ internal sealed class ContextsGenerator : ICodeGenerator
3333
private const string TEMPLATE =
3434
@"public partial class Contexts : JCMG.EntitasRedux.IContexts
3535
{
36-
3736
#if UNITY_EDITOR
3837
3938
static Contexts()
@@ -54,6 +53,8 @@ private static void OnPlayModeStateChanged(UnityEditor.PlayModeStateChange playM
5453
}
5554
}
5655
56+
#endif
57+
5758
public static Contexts SharedInstance
5859
{
5960
get
@@ -68,8 +69,6 @@ public static Contexts SharedInstance
6869
set { _sharedInstance = value; }
6970
}
7071
71-
#endif
72-
7372
static Contexts _sharedInstance;
7473
7574
${contextPropertiesList}

Scripts/VersionConstants.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal static class VersionConstants
3333
/// <summary>
3434
/// The semantic version
3535
/// </summary>
36-
public const string VERSION = "1.3.3";
36+
public const string VERSION = "1.3.4";
3737

3838
/// <summary>
3939
/// The branch of GIT this package was published from.
@@ -43,16 +43,16 @@ internal static class VersionConstants
4343
/// <summary>
4444
/// The current GIT commit hash this package was published on.
4545
/// </summary>
46-
public const string GIT_COMMIT = "2e65c167d3d40b6fbb871deba50e3fd323dacb8f";
46+
public const string GIT_COMMIT = "687c618b3242a5516fa97b3d00ded07d9fff2943";
4747

4848
/// <summary>
4949
/// The UTC human-readable date this package was published at.
5050
/// </summary>
51-
public const string PUBLISH_DATE = "Friday, October 9, 2020";
51+
public const string PUBLISH_DATE = "Thursday, October 15, 2020";
5252

5353
/// <summary>
5454
/// The UTC time this package was published at.
5555
/// </summary>
56-
public const string PUBLISH_TIME = "10/09/2020 12:39:48";
56+
public const string PUBLISH_TIME = "10/15/2020 12:15:03";
5757
}
5858
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"com.jeffcampbellmakesgames.entitasredux","displayName":"JCMG Entitas Redux","version":"1.3.3","unity":"2019.4","description":"Entitas Redux is an fast, accessible, and feature-rich ECS framework for Unity. It leverages code generation and an extensible plugin framework to make life easier for developers.","category":"Scripting","dependencies":{"com.jeffcampbellmakesgames.genesis":"1.3.0"}}
1+
{"name":"com.jeffcampbellmakesgames.entitasredux","displayName":"JCMG Entitas Redux","version":"1.3.4","unity":"2019.4","description":"Entitas Redux is an fast, accessible, and feature-rich ECS framework for Unity. It leverages code generation and an extensible plugin framework to make life easier for developers.","category":"Scripting","dependencies":{"com.jeffcampbellmakesgames.genesis":"1.3.0"}}

0 commit comments

Comments
 (0)