public void FindDataMap() { var path = "Assets/Scripts/ScriptableObjects/"; var objectName = "DataMap.asset"; artNetData = AssetDatabase.LoadAssetAtPath <ArtNetData>(path + objectName); }
private void FindDataMap() { var path = "Assets/Scripts/ScriptableObjects/"; var objectName = "DataMap.asset"; artNetData = AssetDatabase.LoadAssetAtPath <ArtNetData>(path + objectName); if (artNetData == null) { Debug.Log("Couldn't find dataMap. Creating dataMap..."); artNetData = CreateInstance <ArtNetData>(); AssetDatabase.CreateAsset(artNetData, path + objectName); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } }