mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
rename EcsPipelineTemplate.AddCommand to Record
This commit is contained in:
parent
c970111f77
commit
7fe5263825
@ -710,12 +710,12 @@ namespace DCFApixels.DragonECS
|
||||
var it = new LinkedListIterator<SystemNode>(_systemNodes, _systemNodesCount, _startIndex);
|
||||
EcsPipelineTemplate result = new EcsPipelineTemplate();
|
||||
result.layers = new string[Layers.Count];
|
||||
result.systems = new EcsPipelineTemplate.AddCommand[it.Count];
|
||||
result.records = new EcsPipelineTemplate.Record[it.Count];
|
||||
int i = 0;
|
||||
foreach (ref readonly SystemNode node in it)
|
||||
{
|
||||
var prms = new AddParams(node.layerName, node.sortOrder, node.isUnique, AddParamsFlags.None.SetOverwriteAll(true).SetNoImport(true));
|
||||
result.systems[i++] = new EcsPipelineTemplate.AddCommand(node.system, prms);
|
||||
result.records[i++] = new EcsPipelineTemplate.Record(node.system, prms);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -5,14 +5,15 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
[Serializable]
|
||||
[DataContract]
|
||||
[MetaTags(MetaTags.HIDDEN)]
|
||||
public class EcsPipelineTemplate : IEcsModule
|
||||
{
|
||||
[DataMember] public string[] layers;
|
||||
[DataMember] public AddCommand[] systems;
|
||||
[DataMember] public Record[] records;
|
||||
void IEcsModule.Import(EcsPipeline.Builder b)
|
||||
{
|
||||
b.Layers.MergeWith(layers);
|
||||
foreach (var s in systems)
|
||||
foreach (var s in records)
|
||||
{
|
||||
if (s.target == null) { continue; }
|
||||
|
||||
@ -21,11 +22,11 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
[Serializable]
|
||||
[DataContract]
|
||||
public struct AddCommand
|
||||
public struct Record
|
||||
{
|
||||
[DataMember] public object target;
|
||||
[DataMember] public AddParams parameters;
|
||||
public AddCommand(object target, AddParams parameters)
|
||||
public Record(object target, AddParams parameters)
|
||||
{
|
||||
this.target = target;
|
||||
this.parameters = parameters;
|
||||
|
Loading…
Reference in New Issue
Block a user