<commit_before>﻿using UnityEngine;
using System.Collections.Generic;
using System;
using System.IO;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace FMODUnity
{

    [Serializable]
    public enum FMODPlatform
    {
        None,
        PlayInEditor,
        Default,
        Desktop,
        Mobile,
        MobileHigh,
        MobileLow,
        Console,
        Windows,
        Mac,
        Linux,
        iOS,
        Android,
        WindowsPhone,
        XboxOne,
        PS4,
        WiiU,
        PSVita,
        AppleTV,
        UWP,
        Switch,
        WebGL,
        Count,
    }

    [Serializable]
    public enum ImportType
    {
        StreamingAssets,
        AssetBundle,
    }


    public class PlatformSettingBase
    {
        public FMODPlatform Platform;
    }
    
    public class PlatformSetting<T> : PlatformSettingBase
    {
        public T Value;
    }
    
    [Serializable]
    public class PlatformIntSetting : PlatformSetting<int>
    {
    }

    [Serializable]
    public class PlatformStringSetting : PlatformSetting<string>
    {
    }

    public enum TriStateBool
    {
        Disabled,
        Enabled,
        Development,
    }

    [Serializable]
    public class PlatformBoolSetting : PlatformSetting<TriStateBool>
    {
    }

    #if UNITY_EDITOR
    [InitializeOnLoad]
    #endif
    public class Settings : ScriptableObject
    {
        const string SettingsAssetName = "FMODStudioSettings";

        private static Settings instance = null;

        public static Settings Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = Resources.Load(SettingsAssetName) as Settings;
                    if (instance == null)
                    {
                        UnityEngine.Debug.Log("FMOD Studio: cannot find integration settings, creating default settings");
                        instance = CreateInstance<Settings>();
                        instance.name = "FMOD Studio Integration Settings";

                        #if UNITY_EDITOR
                        if (!System.IO.Directory.Exists("Assets/Resources"))
                        {
                            AssetDatabase.CreateFolder("Assets", "Resources");
                        }
                        AssetDatabase.CreateAsset(instance, "Assets/Resources/" + SettingsAssetName + ".asset");
                        #endif
                    }
                }
                return instance;
            }
        }

        #if UNITY_EDITOR
        [MenuItem("FMOD/Edit Settings", priority = 0)]
        public static void EditSettings()
        {
            Selection.activeObject = Instance;
            EditorApplication.ExecuteMenuItem("Window/Inspector");
        }
        #endif

        [SerializeField]
        public bool HasSourceProject = true;

        [SerializeField]
        public bool HasPlatforms = true;<commit_msg>Use 2018.2 menu item path for inspector. (#13)<commit_after>﻿using UnityEngine;
using System.Collections.Generic;
using System;
using System.IO;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace FMODUnity
{

    [Serializable]
    public enum FMODPlatform
    {
        None,
        PlayInEditor,
        Default,
        Desktop,
        Mobile,
        MobileHigh,
        MobileLow,
        Console,
        Windows,
        Mac,
        Linux,
        iOS,
        Android,
        WindowsPhone,
        XboxOne,
        PS4,
        WiiU,
        PSVita,
        AppleTV,
        UWP,
        Switch,
        WebGL,
        Count,
    }

    [Serializable]
    public enum ImportType
    {
        StreamingAssets,
        AssetBundle,
    }


    public class PlatformSettingBase
    {
        public FMODPlatform Platform;
    }
    
    public class PlatformSetting<T> : PlatformSettingBase
    {
        public T Value;
    }
    
    [Serializable]
    public class PlatformIntSetting : PlatformSetting<int>
    {
    }

    [Serializable]
    public class PlatformStringSetting : PlatformSetting<string>
    {
    }

    public enum TriStateBool
    {
        Disabled,
        Enabled,
        Development,
    }

    [Serializable]
    public class PlatformBoolSetting : PlatformSetting<TriStateBool>
    {
    }

    #if UNITY_EDITOR
    [InitializeOnLoad]
    #endif
    public class Settings : ScriptableObject
    {
        const string SettingsAssetName = "FMODStudioSettings";

        private static Settings instance = null;

        public static Settings Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = Resources.Load(SettingsAssetName) as Settings;
                    if (instance == null)
                    {
                        UnityEngine.Debug.Log("FMOD Studio: cannot find integration settings, creating default settings");
                        instance = CreateInstance<Settings>();
                        instance.name = "FMOD Studio Integration Settings";

                        #if UNITY_EDITOR
                        if (!System.IO.Directory.Exists("Assets/Resources"))
                        {
                            AssetDatabase.CreateFolder("Assets", "Resources");
                        }
                        AssetDatabase.CreateAsset(instance, "Assets/Resources/" + SettingsAssetName + ".asset");
                        #endif
                    }
                }
                return instance;
            }
        }

        #if UNITY_EDITOR
        [MenuItem("FMOD/Edit Settings", priority = 0)]
        public static void EditSettings()
        {
            Selection.activeObject = Instance;
            #if UNITY_2018_2_OR_NEWER
            EditorApplication.ExecuteMenuItem("Window/General/Inspector");
            #else
            EditorApplication.ExecuteMenuItem("Window/Inspector");
            #endif
        }
        #endif

        [SerializeField]
        public bool HasSourceProject = true;

        [SerializeField]
        public bool HasPlatforms = true;
{'fraction_non_alphanumeric': 0.070808064251762, 'fraction_numerical': 0.0026225208982134074, 'mean_word_length': 1.4684466019417475, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1983161', 'n_tokens_mistral': 1543, 'n_tokens_neox': 1462, 'n_words': 347}