예제 #1
0
    private void OnEnable()
    {
        //Check if there's a config file
        var configFilePath = AssetDatabase.FindAssets("t:SteamBuilderConfig");

        if (configFilePath.Length > 0)
        {
            UnityEngine.Debug.Log(configFilePath[0]);

            config = AssetDatabase.LoadAssetAtPath <SteamBuilderConfig>(AssetDatabase.GUIDToAssetPath(configFilePath[0]));
        }
        else
        {
            config = ScriptableObjectUtility.CreateAssetAt <SteamBuilderConfig>("Assets/_SkatanicStudios", "Steam Config");
            AssetDatabase.Refresh();
        }

        buildDescription = "v" + Application.version;
    }
예제 #2
0
    void DrawDepots()
    {
        EditorGUI.BeginChangeCheck();
        SerializedProperty prop = serializedConfig.FindProperty("depots");

        EditorGUILayout.BeginHorizontal();
        config.showDepots = EditorGUILayout.Foldout(config.showDepots, $"Depots ({config.depots.Count})");
        if (GUILayout.Button("Add New Depot"))
        {
            var depot = ScriptableObjectUtility.CreateAssetAt <SteamBuilderDepotSettings>("Assets/_SkatanicStudios", "Steam Depot");
            AssetDatabase.Refresh();
            //Create a new depot asset
            config.depots.Add(depot);
        }
        EditorGUILayout.EndHorizontal();

        if (config.showDepots)
        {
            for (int i = 0; i < config.depots.Count; i++)
            {
                EditorGUILayout.Space();
                EditorGUI.indentLevel++;
                EditorGUILayout.BeginVertical("Box");
                config.depots[i] = (SteamBuilderDepotSettings)EditorGUILayout.ObjectField($"Depot #{config.depots[i].depotId}", config.depots[i], typeof(SteamBuilderDepotSettings), false);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.TextField("Content Location", config.depots[i].contentRoot);
                if (GUILayout.Button("Set"))
                {
                    config.depots[i].contentRoot = EditorUtility.OpenFolderPanel("Select Content Root", "", "Living The Deal");
                }
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndVertical();
                EditorGUI.indentLevel--;
            }
        }


        if (EditorGUI.EndChangeCheck())
        {
            EditorUtility.SetDirty(config);
        }
    }