Can ScriptableObject Properties/Fields be set via code?
This is the scriptable object class (example)
public class so1 : SerializedScriptableObject
{
public bool isSquad; // example 1
public bool isTest {get; set;} // example 2
}
This is the code by which I instantiate the scriptable Object and attempt to set it’s fields/properties after having instantiated it:
SO = ScriptableObject.CreateInstance<so1>();
SO.isSquad = true;
SO.isTest.set(true);
AssetDatabase.CreateAsset(SO, "Assets/NewScripableObject.asset");
AssetDatabase.SaveAssets();
This isn’t working. I get the error: Cannot resolve symbol “isSquad”.
However in the debugger I can see the SO in memory with all the fields/properties, so why can I not set them?