예제 #1
0
        public void FindDataMap()
        {
            var path       = "Assets/Scripts/ScriptableObjects/";
            var objectName = "DataMap.asset";

            artNetData = AssetDatabase.LoadAssetAtPath <ArtNetData>(path + objectName);
        }
예제 #2
0
        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();
            }
        }