As already mentioned, the code in your question doesn't produce a CS1026 error. Instead, it produces two
CS0106
errors:
Compiler Error CS0106 | Microsoft Learn[
^]
The problem is that you have two fields with invalid names:
public List<object> ReferencedUnityEngine.Objects;
...
public List<object> PrefabModificationsReferencedUnityEngine.Objects;
The compiler thinks that these are explicit interface implementations, which cannot have access modifiers applied to them.
But in reality, the problem is that field names cannot contain
.
characters.
Depending on what you're actually trying to do, you probably need a separate class:
[Serializable]
public class ObjectWrapper
{
[SerializeField]
public List<object> Objects;
}
You would then change your properties to hold an instance of that class:
[Serializable]
public struct SerializationData
{
...
[SerializeField]
public ObjectWrapper ReferencedUnityEngine;
...
[SerializeField]
public ObjectWrapper PrefabModificationsReferencedUnityEngine;
...
}