private static bool ShouldShowSplashScreen()
        {
            VRCP_CollisionLayerSettings settings = VRCP_CollisionLayerSettings.LoadLayerSettings();

            if (settings == null)
            {
                settings = VRCP_CollisionLayerSettings.GetAndSetShowSetupLayers(true);
            }

            return(settings.showSetupLayers);
        }
        public void OnEnable()
        {
            settings = VRCP_CollisionLayerSettings.LoadLayerSettings();
            if (settings == null)
            {
                settings = VRCP_CollisionLayerSettings.GetAndSetShowSetupLayers(true);
            }

            titleContent = new GUIContent("VRC Prefabs Layer Setup V" + version);

            maxSize = new Vector2(350, 200);
            minSize = maxSize;

            physicsLayers = VRCP_PhysicsLayers.LoadPhysicsLayers();
        }
        void ShowSetupLayer()
        {
            GUILayout.Label("The following layers will be added to your project:");

            layerViewScroll = GUILayout.BeginScrollView(layerViewScroll);

            SerializedObject   serializedObject = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/TagManager.asset")[0]);
            SerializedProperty layerProperty    = serializedObject.FindProperty("layers");

            for (int curLayer = 0; curLayer < physicsLayers.numLayers; ++curLayer)
            {
                bool isPreviousLayer = layerProperty.GetArrayElementAtIndex(physicsLayers.layerInd[curLayer]).stringValue.Trim().Length != 0;

                GUILayout.Label(string.Format("{0}: {1}{2}", physicsLayers.layerInd[curLayer], physicsLayers.layerNames[curLayer], isPreviousLayer ? "*" : ""));
            }
            GUILayout.EndScrollView();

            GUILayout.Space(4);

            GUILayout.Label("* new layer will overwrite current layer");

            GUILayout.Space(4);
            GUILayout.BeginHorizontal();

            if (GUILayout.Button("Import Layers"))
            {
                bool continueSetup = EditorUtility.DisplayDialog(
                    "Import Layers for prefab?",
                    "This will replace any custom layers you have setup for the current project with the layers needed for this prefab. Are you sure you want to continue?",
                    "Continue",
                    "Cancel"
                    );
                if (continueSetup)
                {
                    physicsLayers.SetupLayers();
                    VRCP_CollisionLayerSettings.GetAndSetShowSetupLayers(false);
                    Close();
                }
            }
            if (GUILayout.Button("Ignore"))
            {
                VRCP_CollisionLayerSettings.GetAndSetShowSetupLayers(false);
                Close();
            }

            GUILayout.EndHorizontal();
        }
        void ShowMissingLayersFile()
        {
            GUILayout.Label("There was an issue in reading the layer file. Please reimport the prefab package or message the creator.\nFile path: " + GetAssetPath(VRCP_PhysicsLayers.fileName));

            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Try again"))
            {
                physicsLayers = VRCP_PhysicsLayers.LoadPhysicsLayers();
            }
            if (GUILayout.Button("Ignore"))
            {
                VRCP_CollisionLayerSettings.GetAndSetShowSetupLayers(false);
                Close();
            }

            GUILayout.EndHorizontal();
        }
        public static VRCP_CollisionLayerSettings GetAndSetShowSetupLayers(bool show)
        {
            VRCP_CollisionLayerSettings settings = LoadLayerSettings();
            bool shouldSave = false;

            if (settings == null)
            {
                settings   = ScriptableObject.CreateInstance <VRCP_CollisionLayerSettings>();
                shouldSave = true;
            }

            settings.showSetupLayers = show;
            EditorUtility.SetDirty(settings);
            if (shouldSave)
            {
                AssetDatabase.CreateAsset(settings, VRCP_CollisionLayerSetup.GetAssetPath(fileName));
            }

            AssetDatabase.SaveAssets();

            return(settings);
        }