예제 #1
0
 private void OnEnable()
 {
     if (EditorPrefs.HasKey("ObjectPath"))
     {
         string objectPath = EditorPrefs.GetString("ObjectPath");
         GiantAbilityList = AssetDatabase.LoadAssetAtPath(objectPath, typeof(GiantAbilityList_Scrapped)) as GiantAbilityList_Scrapped;
     }
 }
    public static GiantAbilityList_Scrapped Create()
    {
        GiantAbilityList_Scrapped asset = ScriptableObject.CreateInstance <GiantAbilityList_Scrapped>();

        AssetDatabase.CreateAsset(asset, "Assets/Scripts/_Ability Manager/Giants/GiantAbilityList.asset");
        AssetDatabase.SaveAssets();
        return(asset);
    }
예제 #3
0
    private void CreateNewAbilityList()
    {
        viewIndex = 1;

        GiantAbilityList = CreateGiantAbilityList_Scrapped.Create();
        if (GiantAbilityList)
        {
            GiantAbilityList.GiantAbilities = new List <GiantAbility_Scrapped>();
            string relPath = AssetDatabase.GetAssetPath(GiantAbilityList);
            EditorPrefs.SetString("ObjectPath", relPath);
        }
    }
예제 #4
0
    private void OpenAbilityList()
    {
        string absPath = EditorUtility.OpenFilePanel("Select Ability Item List", "", "");

        if (absPath.StartsWith(Application.dataPath))
        {
            string relPath = absPath.Substring(Application.dataPath.Length - "Assets".Length);
            GiantAbilityList = AssetDatabase.LoadAssetAtPath(relPath, typeof(GiantAbilityList_Scrapped)) as GiantAbilityList_Scrapped;

            if (GiantAbilityList.GiantAbilities == null)
            {
                GiantAbilityList.GiantAbilities = new List <GiantAbility_Scrapped>();
            }
            if (GiantAbilityList)
            {
                EditorPrefs.SetString("ObjectPath", relPath);
            }
        }
    }