private static void CreatePropertiesCollectionAsset() { // Only create asset if it doesn't exist already in resources folder if (Resources.Load <PropertiesCollectionAsset>(PropertiesCollectionAsset.AssetLoadPath) == null) { PropertiesCollectionAsset newAllPropertiesInstance = CreateInstance <PropertiesCollectionAsset>(); newAllPropertiesInstance.properties = new Property[0]; AssetDatabase.CreateAsset(newAllPropertiesInstance, AssetCreationPath); } }
private const string AssetCreationPath = "Assets/Resources/PropertiesCollection.asset"; // Creation path of the properties collection asset via menu private void OnEnable() { PropertiesCollectionAssetInstance = (PropertiesCollectionAsset)target; }