Unity 2020.1.0b5
Whenever I use the Generate Collection Code feature for Ghost Collection Authoring Component the script that is generated contains Trying Keywords before every class.
EX)
public struct Trying intGhostSerializerCollection : IGhostSerializerCollection
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
public string[ ] CreateSerializerNameList()
{
var arr = new string[ ]
{
“CubeGhostSerializer”,
};
return arr;
}
public int Length => 1;
#endif
public static int FindGhostType()
where T : struct, ISnapshotData
{
if (typeof(T) == typeof(CubeSnapshotData))
return 0;
return -1;
}
public void BeginSerialize(ComponentSystemBase system)
{
m_CubeGhostSerializer.BeginSerialize(system);
}
public int CalculateImportance(int serializer, ArchetypeChunk chunk)
{
switch (serializer)
{
case 0:
return m_CubeGhostSerializer.CalculateImportance(chunk);
}
throw new ArgumentException(“Invalid serializer type”);
}
public int GetSnapshotSize(int serializer)
{
switch (serializer)
{
case 0:
return m_CubeGhostSerializer.SnapshotSize;
}
throw new ArgumentException(“Invalid serializer type”);
}
public int Serialize(ref DataStreamWriter dataStream, SerializeData data)
{
switch (data.ghostType)
{
case 0:
{
return GhostSendSystem<Trying intGhostSerializerCollection>.InvokeSerialize<CubeGhostSerializer, CubeSnapshotData>(m_CubeGhostSerializer, ref dataStream, data);
}
default:
throw new ArgumentException(“Invalid serializer type”);
}
}
private CubeGhostSerializer m_CubeGhostSerializer;
}
public struct EnableTrying intGhostSendSystemComponent : IComponentData
{}
public class Trying intGhostSendSystem : GhostSendSystem<Trying intGhostSerializerCollection>
{
protected override void OnCreate()
{
base.OnCreate();
RequireSingletonForUpdate<EnableTrying intGhostSendSystemComponent>();
}
public override bool IsEnabled()
{
return HasSingleton<EnableTrying intGhostSendSystemComponent>();
}
}
If I remove the Trying from the generated code it fixes the compiler errors.
This is happening for the generated scripts : GhostSerializerCollection and and GhostDeserializerCollection