Пример #1
0
        public GrabbitSettings GetOrFetchSettings(bool noWarning = false)
        {
            if (!CurrentSettings)
            {
                var ids = AssetDatabase.FindAssets("t:GrabbitSettings");
                if (ids.Length == 0)
                {
                    if (!noWarning)
                    {
                        Debug.LogWarning("No Grabbit settings found, please contact us on Discord!");
                    }
                    return(null);
                }

                CurrentSettings = AssetDatabase.LoadAssetAtPath <GrabbitSettings>(AssetDatabase.GUIDToAssetPath(ids[0]));

                if (!CurrentSettings)
                {
                    if (!noWarning)
                    {
                        Debug.LogWarning("Grabbit could not locate the settings: please contact us on Discord!");
                    }
                    return(null);
                }

                CurrentSettings.InitializeStyle(true);
            }

            return(CurrentSettings);
        }
Пример #2
0
        private bool PrepareSettings()
        {
            if (CurrentSettings)
            {
                CurrentSettings.InitializeStyle();
            }
            else
            {
                FetchSettings();

                if (CurrentSettings)
                {
                    CurrentSettings.InitializeStyle();
                }
                else
                {
                    return(false);
                }
            }

            return(true);
        }
        public void OnGUI()
        {
            CurrentSettings.InitializeStyle();

            switch (CurrentStep)
            {
            case StartingStep.INTRO:
                ShowIntro();
                break;

            case StartingStep.SETUP_INTRO:
                SetupIntro();
                break;

            case StartingStep.CONVEX_COLLIDERS:
                ConvexColliders();
                break;

            case StartingStep.BIG_SCENE:
                BigSceneSetup();
                break;

            case StartingStep.PRECISION_VS_PERF:
                PrecisionPerfSetup();
                break;

            case StartingStep.GETTING_FURTHER:
                GettingFurther();
                break;

            case StartingStep.TUTORIAL:
                Tutorial();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #4
0
        private void FetchSettings()
        {
            if (!CurrentSettings)
            {
                var ids = AssetDatabase.FindAssets("t:GrabbitSettings");
                if (ids.Length == 0)
                {
                    Debug.LogWarning("No Grabbit settings found, please contact us on Discord!");
                    return;
                }

                CurrentSettings = AssetDatabase.LoadAssetAtPath <GrabbitSettings>(AssetDatabase.GUIDToAssetPath(ids[0]));

                if (!CurrentSettings)
                {
                    Debug.LogWarning("Grabbit could not locate the settings: please contact us on Discord!");
                }
                else
                {
                    CurrentSettings.InitializeStyle(true);
                }
            }

            if (!ColliderMeshContainer)
            {
                var ids = AssetDatabase.FindAssets("t:ColliderMeshContainer");
                if (ids.Length == 0)
                {
                    //   GUIHelper.DisplayMessage("Grabbit Error: No Collider Mesh Container, please create one!");
                    return;
                }

                ColliderMeshContainer =
                    AssetDatabase.LoadAssetAtPath <ColliderMeshContainer>(AssetDatabase.GUIDToAssetPath(ids[0]));
            }

            titleContent = new GUIContent(" Grabbit", CurrentSettings.GrabbitLogo, "It's a Rabbit that Grabs!");
        }