2025-03-14 16:53:25 +08:00
|
|
|
|
#if DISABLE_DEBUG
|
|
|
|
|
#undef DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
using System;
|
2024-06-26 00:07:31 +08:00
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
2024-06-26 00:14:58 +08:00
|
|
|
|
namespace DCFApixels.DragonECS
|
2024-06-26 00:07:31 +08:00
|
|
|
|
{
|
2024-10-12 14:48:13 +08:00
|
|
|
|
using static EcsConsts;
|
|
|
|
|
|
2024-06-26 00:07:31 +08:00
|
|
|
|
[Serializable]
|
|
|
|
|
[DataContract]
|
2024-09-16 12:25:14 +08:00
|
|
|
|
[MetaTags(MetaTags.HIDDEN)]
|
2024-10-12 14:48:13 +08:00
|
|
|
|
[MetaDescription(AUTHOR, "...")]
|
|
|
|
|
[MetaGroup(PACK_GROUP, OTHER_GROUP)]
|
2024-10-12 00:08:12 +08:00
|
|
|
|
[MetaID("128D547C9201EEAC49B05F89E4A253DF")]
|
2024-10-12 14:48:13 +08:00
|
|
|
|
[MetaColor(MetaColor.DragonRose)]
|
2024-06-26 00:07:31 +08:00
|
|
|
|
public class EcsPipelineTemplate : IEcsModule
|
|
|
|
|
{
|
|
|
|
|
[DataMember] public string[] layers;
|
2024-09-16 12:25:14 +08:00
|
|
|
|
[DataMember] public Record[] records;
|
2024-06-26 01:35:40 +08:00
|
|
|
|
void IEcsModule.Import(EcsPipeline.Builder b)
|
2024-06-26 00:07:31 +08:00
|
|
|
|
{
|
|
|
|
|
b.Layers.MergeWith(layers);
|
2024-09-16 12:25:14 +08:00
|
|
|
|
foreach (var s in records)
|
2024-06-26 00:07:31 +08:00
|
|
|
|
{
|
2024-08-14 21:23:34 +08:00
|
|
|
|
if (s.target == null) { continue; }
|
2024-06-26 01:35:40 +08:00
|
|
|
|
|
2024-08-14 21:23:34 +08:00
|
|
|
|
b.Add(s.target, s.parameters);
|
2024-06-26 00:07:31 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-26 01:35:40 +08:00
|
|
|
|
[Serializable]
|
|
|
|
|
[DataContract]
|
2024-09-16 12:25:14 +08:00
|
|
|
|
public struct Record
|
2024-06-26 01:35:40 +08:00
|
|
|
|
{
|
2024-08-14 21:23:34 +08:00
|
|
|
|
[DataMember] public object target;
|
|
|
|
|
[DataMember] public AddParams parameters;
|
2024-09-16 12:25:14 +08:00
|
|
|
|
public Record(object target, AddParams parameters)
|
2024-06-26 01:35:40 +08:00
|
|
|
|
{
|
2024-08-14 21:23:34 +08:00
|
|
|
|
this.target = target;
|
|
|
|
|
this.parameters = parameters;
|
2024-06-26 01:35:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-26 00:07:31 +08:00
|
|
|
|
}
|
|
|
|
|
}
|