Exemplo n.º 1
0
        public void OnGUI()
        {
            GUILayout.BeginVertical();

            if (GUILayout.Button("Complete with 1 star"))
            {
                LevelsMap.CompleteLevel(LevelNumber, 1);
                GoBack();
            }

            if (GUILayout.Button("Complete with 2 star"))
            {
                LevelsMap.CompleteLevel(LevelNumber, 2);
                GoBack();
            }

            if (GUILayout.Button("Complete with 3 star"))
            {
                LevelsMap.CompleteLevel(LevelNumber, 3);
                GoBack();
            }

            if (GUILayout.Button("Back"))
            {
                GoBack();
            }

            GUILayout.EndVertical();
        }
Exemplo n.º 2
0
        public void OnGUI()
        {
            GUILayout.BeginVertical();

            DrawToggleShowButton();

            if (_isShow)
            {
                DrawInputParameters();
                if (GUILayout.Button("Complete all  levels"))
                {
                    for (int i = 1; i < GameObject.Find("Levels").transform.childCount; i++)
                    {
                        // LevelsMap.CompleteLevel(i, _starsCount);
                        SaveLevelStarsCount(i, _starsCount);
                    }
                }

                if (GUILayout.Button("Complete level"))
                {
                    if (LevelsMap.IsStarsEnabled())
                    {
                        LevelsMap.CompleteLevel(_levelNumber, _starsCount);
                    }
                    else
                    {
                        LevelsMap.CompleteLevel(_levelNumber);
                    }
                }

                if (GUILayout.Button("Go to level"))
                {
                    LevelsMap.GoToLevel(_levelNumber);
                }

                if (GUILayout.Button("Is level locked"))
                {
                    bool isLocked = LevelsMap.IsLevelLocked(_levelNumber);
                    Debug.Log(string.Format("Level {0} is {1}",
                                            _levelNumber,
                                            isLocked ? "locked" : "not locked"));
                }

                if (GUILayout.Button("Clear all progress"))
                {
                    LevelsMap.ClearAllProgress();
                }
            }

            GUILayout.EndVertical();
        }