Last active
February 27, 2019 13:39
-
-
Save ZeredaGames/eb204c344499851f8e9276e2c86bacbc to your computer and use it in GitHub Desktop.
Option A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region usings | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
//using UnityEngine.UI; | |
//using UnityEngine.SceneManagement; | |
//using System; | |
//using System.Collections; | |
using System.Collections.Generic; | |
#endregion | |
#region Script | |
namespace ZeredaGamesEngine.Core.MusicListsExamples.Example3 | |
{ | |
#region Attributes | |
//[RequireComponent (typeof())] | |
[System.Serializable] | |
#endregion | |
[CreateAssetMenu(menuName = "My custom button name", fileName = "NewInstanceOf_MyScriptableObject.asset")] | |
public class MusicAssetList : ScriptableObject{ | |
public List<AudioClip> PlayList = new List<AudioClip>(); | |
/// <summary> | |
/// Creates the general music list asset. | |
/// </summary> | |
/// <returns>The general music list asset.</returns> | |
/// <param name="index">Index.</param> | |
[MenuItem ("Window/Editor Tools/ZeredaGames/Game Making Editor Tools/Create Playlist-General Music", false, 1)] | |
public static MusicAssetList CreateNewAsset () | |
{ | |
string AssetName = "Assets/Resources/Music/GeneralMusicList.asset"; | |
MusicAssetList asset = ScriptableObject.CreateInstance<MusicAssetList> (); | |
AssetDatabase.CreateAsset (asset, AssetName); | |
AssetDatabase.SaveAssets (); | |
EditorUtility.FocusProjectWindow (); | |
Selection.activeObject = asset; | |
return asset; | |
} | |
} | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment