I really like using this pattern in my Unity classes:
[field: SerializeField]
public int Num { get; private set; }
This allows other classes to read the value, but not set it. The field: tag allows Unity to properly serialize the property for the inspector. But the same pattern doesn't work for Alchemy. For example:
using System;
using System.Collections.Generic;
using Alchemy.Serialization;
using UnityEngine;
[AlchemySerialize]
public partial class FooSO : ScriptableObject
{
[field: AlchemySerializeField, NonSerialized]
public HashSet<int> Nums { get; private set; }
}
The Nums property will not be visible in the inspector. But if you turn it into a normal field, it works:
[AlchemySerializeField, NonSerialized]
public HashSet<int> Nums;
Can support for properties be added for Alchemy too?
I really like using this pattern in my Unity classes:
This allows other classes to read the value, but not set it. The
field:tag allows Unity to properly serialize the property for the inspector. But the same pattern doesn't work for Alchemy. For example:The
Numsproperty will not be visible in the inspector. But if you turn it into a normal field, it works:Can support for properties be added for Alchemy too?