Ejemplo n.º 1
0
        void LoadLevelScreen(OutGameButton sender)
        {
            OutGameButtonChapter chapter_button = (OutGameButtonChapter)sender;

            data.current_chapter = chapter_button.Chapter;
            LoadScreen("OutGame_Level_Screen");
        }
Ejemplo n.º 2
0
        void ScrollCamera(OutGameButton sender)
        {
            OutGameButtonScroll scroll = (OutGameButtonScroll)sender;

            //camera.transform.Translate (scroll.direction * scroll.speed);
            foreach (GameObject movable in movable_objects)
            {
                movable.SendMessage("SetTarget", scroll.direction);
            }
        }
Ejemplo n.º 3
0
        void ShowPreLevel(OutGameButton sender)
        {
            OutGameButtonLevel level_button = (OutGameButtonLevel)sender;

            //data.LoadLevel (level_button.Level.chapter,level_button.Level.index);
            data.LoadLevel(level_button.Level);


            if (pre_Level != null)
            {
                pre_Level.SetActive(true);
                pre_Level.SendMessage("Display");
                screen = Screen.PreLevel;
            }
        }
Ejemplo n.º 4
0
        void StartLevel(OutGameButton sender)
        {
            //Sound.PlayBGS("Game_BGS");

            PlayLevel();
        }
Ejemplo n.º 5
0
        public void ReportEvent(OutGameButton sender)
        {
            MenuEvent menuEvent = sender.MENU_EVENT;

            bool conf = sender.require_confirmation;

            switch (menuEvent)
            {
            case MenuEvent.Back:
                if (screen != Screen.Confirmation)
                {
                    LoadLastScreen();
                }
                else
                {
                    DestroyConfirmationWindow();
                }
                break;

            case MenuEvent.MenuScreen:
                LoadMenuScreen();
                break;

            case MenuEvent.ChapterScreen:
                if (screen == Screen.PreLevel)
                {
                    ClosePreLevel();
                }
                else
                {
                    LoadChapterScreen();
                }
                break;

            case MenuEvent.LevelScreen:
                if (screen == Screen.ChapterSelection)
                {
                    LoadLevelScreen(sender);
                }
                else
                {
                    if (!conf || screen == Screen.Confirmation)
                    {
                        DestroyConfirmationWindow();
                        BackToLevelScreen();
                    }
                    else
                    {
                        CreateConfirmationWindow(menuEvent);
                    }
                }
                break;

            case MenuEvent.PreLevel:
                ShowPreLevel(sender);
                break;

            case MenuEvent.GameScreen:
                StartLevel(sender);
                break;

            case MenuEvent.Som:
                ToggleSound();
                Report.ToggleSound(sender.pressed);

                break;

            case MenuEvent.CreditsScreen:
                LoadCreditsScreen();
                break;

            case MenuEvent.RestartLevel:
                if (!conf || screen == Screen.Confirmation)
                {
                    DestroyConfirmationWindow();
                    RestartLevel();
                }
                else
                {
                    CreateConfirmationWindow(menuEvent);
                }
                break;

            case MenuEvent.NextLevel:
                NextLevel();
                break;

            case MenuEvent.ScrollRight:
                if (screen == Screen.PreLevel)
                {
                    NextPreLevel(+1);
                }
                else
                if (current_view + 1 <= views)
                {
                    current_view++;
                    ScrollCamera(sender);
                }

                break;

            case MenuEvent.ScrollLeft:
                if (screen == Screen.PreLevel)
                {
                    NextPreLevel(-1);
                }
                else
                if (current_view - 1 >= 1)
                {
                    current_view--;
                    ScrollCamera(sender);
                }
                break;

            case MenuEvent.LinkAtomic:
                OpenLink("http://atomicrocket.com.br");
                break;
            }
        }