Ejemplo n.º 1
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_CAMERA_ALT);
        gui = new GUIManager(thisMetalGUISkin);
        gui.OnClick += HandleGuiOnClick;
        gui.OnToggle += HandleGuiOnToggle;
        gui.OnScroll += HandleGuiOnScroll;

        prefs = MasterController.BRAIN.pm();
        pc = MasterController.BRAIN.pci();

        pc.onGesturePerformed += HandlePconGesturePerformed;

        _terrain_num = prefs.get_tileNum();
        _format_num = prefs.get_eqFormat();
        _alien_speed = prefs.get_alienSpeed();
        _num_to_win = prefs.get_numWin();
        loadSettingsFromPreferences();

        gui.CreateGUIObject(LEVEL_EDITOR,
                            "Level Editor",
                            new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(18*(Screen.height/100))),
                            GUIType.Label,
                            "label");
        //Reset
        gui.CreateGUIObject(RESET,
                            "Reset",
                            new Rect(71*(Screen.width/100) ,(94*(Screen.height/100)) ,(3*(Screen.width/10)) ,(15*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        //Save
        gui.CreateGUIObject(SAVE,
                            "Save",
                            new Rect(42*(Screen.width/100) ,(94*(Screen.height/100)) ,(29*(Screen.width/100)) ,(15*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        //Custom Game
        gui.CreateGUIObject(CUSTOM_GAME,
                            "Custom",
                            new Rect((Screen.width/100) ,(94*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        //Terrain Selection
        gui.CreateGUIObject(TERRAIN_SELECTION,
                            "Terrain Selection",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*30,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(TERRAIN0,
                            terrainNames[0],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*35, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[0]);
        gui.CreateGUIObject(TERRAIN1,
                            terrainNames[1],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*35, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[1]);
        gui.CreateGUIObject(TERRAIN2,
                            terrainNames[2],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*40, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[2]);
        gui.CreateGUIObject(TERRAIN3,
                            terrainNames[3],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*40, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[3]);
        gui.CreateGUIObject(TERRAIN4,
                            terrainNames[4],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*45, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[4]);
        gui.CreateGUIObject(TERRAIN5,
                            terrainNames[5],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*45, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[5]);
        gui.CreateGUIObject(TERRAIN6,
                            terrainNames[6],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*50, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[6]);
        gui.CreateGUIObject(TERRAIN7,
                            terrainNames[7],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*50, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[7]);
        //Math Operations
        gui.CreateGUIObject(MATH_OPERATIONS,
                            "Math Operations",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*55,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(PLUS,
                            "+",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*60, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[0]);
        gui.CreateGUIObject(MINUS,
                            "-",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*60, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[1]);
        gui.CreateGUIObject(MULTIPLY,
                            "X",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*65, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[2]);
        gui.CreateGUIObject(DIVIDE,
                            "%",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*65, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[3]);
        //Equation Format
        gui.CreateGUIObject(FORMAT,
                            "Format: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*70,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS2,
                            "-",
                            new Rect((Screen.width/100)*40, (Screen.height/100)*70,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(EQUATION_FORMAT,
                            formatArray[_format_num],
                            new Rect((Screen.width/100)*45, (Screen.height/100)*71,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        gui.CreateGUIObject(PLUS2,
                            "+",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*70,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        //win set
        gui.CreateGUIObject(NUMBER_TO_WIN,
                            "Number to win? ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*75,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS3,
                            "-",
                            new Rect((Screen.width/100)*50, (Screen.height/100)*75,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(PLUS3,
                            "+",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*75,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(NUMBER_TO_WIN_VALUE,
                            _num_to_win.ToString(),
                            new Rect((Screen.width/100)*55, (Screen.height/100)*76,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        //Alien Speed
        gui.CreateGUIObject(ALIEN_SPEED,
                            "Alien Speed: " + (Mathf.Round(_alien_speed *100f)/100f),
                            new Rect((Screen.width/100)*20, (Screen.height/100)*80,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(ALIEN_SLIDER_SPEED,
                            "ALIEN_SLIDER_SPEED",
                            new Rect ((Screen.width/100)*50, (Screen.height/100)*80, (Screen.width/100)*20, (Screen.height/100)*2),
                            GUIType.Slider,
                            "",
                            false,
                            0.25f,
                            1.0f,
                            _alien_speed);

        gui.connect(TERRAIN0,TERRAIN1,TERRAIN1,CUSTOM_GAME,TERRAIN2);
        gui.connect(TERRAIN1,TERRAIN0,TERRAIN0,CUSTOM_GAME,TERRAIN3);
        gui.connect(TERRAIN2,TERRAIN3,TERRAIN3,TERRAIN0,TERRAIN4);
        gui.connect(TERRAIN3,TERRAIN2,TERRAIN2,TERRAIN1,TERRAIN5);
        gui.connect(TERRAIN4,TERRAIN5,TERRAIN5,TERRAIN2,TERRAIN6);
        gui.connect(TERRAIN5,TERRAIN4,TERRAIN4,TERRAIN3,TERRAIN7);
        gui.connect(TERRAIN6,TERRAIN7,TERRAIN7,TERRAIN4,PLUS);
        gui.connect(TERRAIN7,TERRAIN6,TERRAIN6,TERRAIN5,MINUS);
        gui.connect(PLUS,MINUS,MINUS,TERRAIN6,MULTIPLY);
        gui.connect(MINUS,PLUS,PLUS,TERRAIN7,DIVIDE);
        gui.connect(MULTIPLY,DIVIDE,DIVIDE,MINUS,FORMAT);
        gui.connect(DIVIDE,MULTIPLY,MULTIPLY,MINUS,FORMAT);
        gui.connect(FORMAT,MINUS2,PLUS2,MULTIPLY,NUMBER_TO_WIN);
        gui.connect(NUMBER_TO_WIN,MINUS3,PLUS3,FORMAT,ALIEN_SPEED);
        gui.connect(ALIEN_SPEED,"","",NUMBER_TO_WIN,CUSTOM_GAME);
        gui.connect(CUSTOM_GAME,RESET,SAVE,ALIEN_SPEED,TERRAIN0);
        gui.connect(SAVE,CUSTOM_GAME,RESET,ALIEN_SPEED,TERRAIN0);
        gui.connect(RESET,SAVE,CUSTOM_GAME,ALIEN_SPEED,TERRAIN0);

        gui.connect(MINUS1,"",NUMBER_OF_TERRAINS,"","");
        gui.connect(PLUS1,NUMBER_OF_TERRAINS,"","","");
        gui.connect(MINUS2,"",FORMAT,"","");
        gui.connect(PLUS2,FORMAT,"","","");
        gui.connect(MINUS3,"",NUMBER_TO_WIN,"","");
        gui.connect(PLUS3,NUMBER_TO_WIN,"","","");

        gui.pointer = TERRAIN0;
    }
Ejemplo n.º 2
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_MAIN_MENU);
        pc = MasterController.BRAIN.pci();
        gui = new GUIManager(thisMetalGUISkin);
        gui.OnClick += HandleGuiOnClick;
        pc.onGesturePerformed += HandlePconGesturePerformed;
        gui.CreateGUIObject(TITLE,
                            "Mathius: Defender of Earth!",
                            new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(18*(Screen.height/100))),
                            GUIType.Label,
                            "label");
        gui.CreateGUIObject(START_GAME,
                            "START GAME",
                            new Rect(Screen.width/3 ,(23*(Screen.height/100)) ,(2*(Screen.width/5)) ,(10*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        gui.CreateGUIObject(LEVEL_EDITOR,
                            "SETTINGS",
                            new Rect((Screen.width/3),(35*(Screen.height/100)),(2*(Screen.width/5)),(10*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        gui.CreateGUIObject(OPTIONS,
                            "OPTIONS",
                            new Rect((Screen.width/3),(46*(Screen.height/100)),(2*(Screen.width/5)),(10*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        gui.CreateGUIObject(HIGH_SCORE,
                            "HIGH SCORE",
                            new Rect(Screen.width/3,(57*(Screen.height/100)), (2*(Screen.width/5)), (10*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        gui.CreateGUIObject(CREDITS,
                            "CREDITS",
                            new Rect(Screen.width/3,(68*(Screen.height/100)),(2*(Screen.width/5)),(10*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        gui.CreateGUIObject(EXIT,
                            "EXIT",
                            new Rect(Screen.width/3,(79*(Screen.height/100)), (2*(Screen.width/5)), (10*(Screen.height/100))),
                            GUIType.Button,
                            "box");

        gui.connect(START_GAME,null,null,EXIT,LEVEL_EDITOR);
        gui.connect(LEVEL_EDITOR,null,null,START_GAME,OPTIONS);
        gui.connect(OPTIONS,null,null,LEVEL_EDITOR,HIGH_SCORE);
        gui.connect(HIGH_SCORE,null,null,OPTIONS,CREDITS);
        gui.connect(CREDITS,null,null,HIGH_SCORE,EXIT);
        gui.connect(EXIT,null,null,CREDITS,START_GAME);

        gui.pointer = START_GAME;
    }
Ejemplo n.º 3
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_CAMERA_ALT);
        gui = new GUIManager(thisMetalGUISkin);

        gui.OnClick += HandleGuiOnClick;
        gui.CreateGUIObject(NEXT,
                            "Next",
                            new Rect(8*(Screen.width/10) ,(95*(Screen.height/100)) ,(2*(Screen.width/10)) ,(10*(Screen.height/100))),
                            GUIType.Button,
                            "box");

        pc = MasterController.BRAIN.pci();

        pc.onGesturePerformed += HandlePconGesturePerformed;
        stats = MasterController.BRAIN.sm();
        gs = 0;
        MUI = gameObject.GetComponent<Mathius_UI>();
        creditTimer = 20.0f;

        gui.connect(NEXT,NEXT,NEXT,NEXT,NEXT);
        gui.pointer = NEXT;
    }
Ejemplo n.º 4
0
    void Start()
    {
        _initial = InputInitial.ONE;
        MasterController.BRAIN.onEnterMenu();
        pc = MasterController.BRAIN.pci();
        pc.onGesturePerformed += HandlePconGesturePerformed;
        _score = MasterController.BRAIN.sm().get_score();
        _highScore = MasterController.BRAIN.hsm();
        _hsi = MasterController.BRAIN.hsi();
        if(_highScore.get_isHighScore()){//if it is a highscore!
            _hsi.onSuccessSwipe += Handle_hsionSuccessSwipe;
            _state = State.INPUT;
        }else{
            _state = State.DISPLAY;
            _highScore.saveScores();
        }
        _highScore.set_isHighScore(false);

        //Now to the actual gui making!
        guiInput = new GUIManager(thisMetalGUISkin);
        guiDisplay = new GUIManager(thisMetalGUISkin);

        //Input
        guiInput.OnClick += HandleGuiInputOnClick;

        guiInput.CreateGUIObject(HIGHSCORE,
                                 "HighScore",
                                 new Rect((Screen.width/5),(15*(Screen.height/100)),(3*(Screen.width/5)),(10*(Screen.height/100))),
                                 GUIType.Label,
                                 "box");
        guiInput.CreateGUIObject(SCORE,
                                 ("SCORE: " + _score),
                                 new Rect((Screen.width/5),(27*(Screen.height/100)),(3*(Screen.width/5)),(10*(Screen.height/100))),
                                 GUIType.Label,
                                 "box");
        guiInput.CreateGUIObject(INITIALS,
                                 (_hsi.initials()),
                                 new Rect((Screen.width/5),(45*(Screen.height/100)),(3*(Screen.width/5)),(10*(Screen.height/100))),
                                 GUIType.Label,
                                 "box");

        //left most

        guiInput.CreateGUIObject(UP1,
                                " /\\",
                                new Rect((Screen.width/100)*45, (Screen.height/100)*45,(Screen.width/100)*2, (Screen.height/100)*5),
                                GUIType.Button,
                             	"button",
                                false,
                                0.0f,
                                0.0f,
                                0.0f,
                                false);
        guiInput.CreateGUIObject(DOWN1,
                                 " \\/",
                                 new Rect((Screen.width/100)*45, (Screen.height/100)*55,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        //---end left most

        //center
        guiInput.CreateGUIObject(UP2,
                                 " /\\",
                                 new Rect((Screen.width/100)*50, (Screen.height/100)*45,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        guiInput.CreateGUIObject(DOWN2,
                                 " \\/",
                                 new Rect((Screen.width/100)*50, (Screen.height/100)*55,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        //---end center

        //far right
        guiInput.CreateGUIObject(UP3,//right up button
                                 " /\\",
                                 new Rect((Screen.width/100)*54, (Screen.height/100)*45,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);
        guiInput.CreateGUIObject(DOWN3, //right down button
                                 " \\/",
                                 new Rect((Screen.width/100)*54, (Screen.height/100)*55,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button",
                                 false,
                                 0.0f,
                                 0.0f,
                                 0.0f,
                                 false);

        //---end far right

        guiInput.CreateGUIObject(ENTER,
                                 "ENTER",
                                 new Rect((Screen.width/20) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                                 GUIType.Button,
                                 "box");
        guiInput.CreateGUIObject(LEFT,
                                 "<",
                                 new Rect((Screen.width/100)*42, (Screen.height/100)*50,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button");
        guiInput.CreateGUIObject(RIGHT,
                                 ">",
                                 new Rect((Screen.width/100)*58, (Screen.height/100)*50,(Screen.width/100)*2, (Screen.height/100)*5),
                                 GUIType.Button,
                                 "button");

        //Display
        guiDisplay.OnClick += HandleGuiDisplayOnClick;

        guiDisplay.CreateGUIObject(MAINMENU,
                                   "Main Menu",
                                   new Rect(5*(Screen.width/10) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                                   GUIType.Button,
                                   "box");
        guiDisplay.CreateGUIObject(REPLAY,
                                   "Replay",
                                   new Rect((Screen.width/20) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                                   GUIType.Button,
                                   "box");
        guiDisplay.CreateGUIObject(GAMEOVER,
                                   "GameOver",
                                   new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(10*(Screen.height/100))),
                                   GUIType.Label,
                                   "label");
        guiDisplay.CreateGUIObject(FINAL_SCORE,
                                   ("SCORE: " + _score),
                                   new Rect((Screen.width/5),(47*(Screen.height/100)),(3*(Screen.width/5)),(18*(Screen.height/100))),
                                   GUIType.Label,
                                   "label");

        guiInput.connect(UP1,ENTER,UP2,"",DOWN1);
        guiInput.connect(UP2,UP1,UP3,"",DOWN2);
        guiInput.connect(UP3,UP2,ENTER,"",DOWN3);
        guiInput.connect(DOWN1,ENTER,DOWN2,UP1,"");
        guiInput.connect(DOWN2,DOWN1,DOWN3,UP2,"");
        guiInput.connect(DOWN3,DOWN2,ENTER,UP3,"");
        guiInput.connect(ENTER,UP3,UP1,UP1,UP1);

        guiInput.pointer = UP1;

        guiDisplay.connect(REPLAY,MAINMENU,MAINMENU,"","");
        guiDisplay.connect(MAINMENU,REPLAY,REPLAY,"","");
        guiDisplay.pointer = REPLAY;
    }
Ejemplo n.º 5
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_CAMERA_ALT);
        gui = new GUIManager(thisMetalGUISkin);
        gui.OnClick += HandleGuiOnClick;
        pc = MasterController.BRAIN.pci();
        pc.onGesturePerformed += HandlePconGesturePerformed;
        gui.CreateGUIObject(HIGH_SCORES,
                            "High Scores",
                            new Rect((Screen.width/5)/2,(3*Screen.height/100),(4*(Screen.width/5)),(18*Screen.height/100)),
                            GUIType.Label,
                            "label");
        gui.CreateGUIObject(PLAYER1,
                            ("1:\t\t\t" + PlayerPrefs.GetInt("Player H0") +" "+ PlayerPrefs.GetString("Player 0","A")),
                            new Rect((Screen.width/55),(35*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER2,
                            ("2:\t\t\t" + PlayerPrefs.GetInt("Player H1",1)+" "+ PlayerPrefs.GetString("Player 1","B")),
                            new Rect((Screen.width/55),(45*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER3,
                            ("3:\t\t\t" + PlayerPrefs.GetInt("Player H2",2) +" "+ PlayerPrefs.GetString("Player 2","C")),
                            new Rect((Screen.width/55),(55*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER4,
                            ("4:\t\t\t" + PlayerPrefs.GetInt("Player H3",3)+" "+ PlayerPrefs.GetString("Player 3","D")),
                            new Rect((Screen.width/55),(65*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER5,
                            ("5:\t\t\t" + PlayerPrefs.GetInt("Player H4",4) +" "+ PlayerPrefs.GetString("Player 4","E")),
                            new Rect((Screen.width/55),(75*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER6,
                            ("6:\t\t\t" + PlayerPrefs.GetInt("Player H5",5)+" "+ PlayerPrefs.GetString("Player 5","F")),
                            new Rect((Screen.width/10)*5,(35*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER7,
                            ("7:\t\t\t" + PlayerPrefs.GetInt("Player H6",6) +" "+ PlayerPrefs.GetString("Player 6","G")),
                            new Rect((Screen.width/10)*5,(45*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER8,
                            ("8:\t\t\t" + PlayerPrefs.GetInt("Player H7",7)+" "+ PlayerPrefs.GetString("Player 7","H")),
                            new Rect((Screen.width/10)*5,(55*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER9,
                            ("9:\t\t\t" + PlayerPrefs.GetInt("Player H8",8) +" "+ PlayerPrefs.GetString("Player 8","I")),
                            new Rect((Screen.width/10)*5,(65*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(PLAYER10,
                            ("10:\t\t\t" + PlayerPrefs.GetInt("Player H9",9)+" "+ PlayerPrefs.GetString("Player 9","J")),
                            new Rect((Screen.width/10)*5,(75*Screen.height/100),(50*(Screen.width/100)),(9*Screen.height/100)),
                            GUIType.Label,
                            "box");
        gui.CreateGUIObject(MAINMENU,
                            "Main Menu",
                            new Rect(5*(Screen.width/10) ,(90*Screen.height/100) ,(4*(Screen.width/10)) ,(15*Screen.height/100) ),
                            GUIType.Button,
                            "box");

        gui.connect(MAINMENU,MAINMENU,MAINMENU,MAINMENU,MAINMENU);
        gui.pointer = MAINMENU;
    }
Ejemplo n.º 6
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_CAMERA_ALT);
        prefs = MasterController.BRAIN.pm();
        pc = MasterController.BRAIN.pci();
        gui = new GUIManager(thisMetalGUISkin);

        gui.OnClick += HandleGuiOnClick;
        gui.OnScroll += HandleGuiOnScroll;
        gui.OnToggle += HandleGuiOnToggle;
        pc.onGesturePerformed += HandlePconGesturePerformed;

        _sfx = prefs.get_SFXVolume();
        _music = prefs.get_musicVolume();
        _sound = prefs.get_perceptualVolumeMode ();
        _texture = prefs.get_mathiusTexture();
        _perceptual = prefs.get_usePerceptual();
        _mute = prefs.get_mute();
        _mathiusTextures = MasterController.BRAIN._mathiusTextures;

        _texturemap = new Dictionary<string, Texture>();
        for(int i=0,  j=0; i<_mathiusTextures.Length && j<colorArray.Length; i++,j++){
            _texturemap.Add(colorArray[j],_mathiusTextures[i]);
        }

        MasterController.BRAIN.m().set_texture(_texturemap[colorArray[prefs.get_mathiusTexture()]]);
        //Options
        gui.CreateGUIObject(OPTIONS,
                            "Options",
                            new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(18*(Screen.height/100))),
                            GUIType.Label,
                            "label");
        //Mathius Color
        gui.CreateGUIObject(MATHIUS_COLOR,
                            "Mathius Color: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*25,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS1,
                            "-",
                            new Rect((Screen.width/100)*50, (Screen.height/100)*25,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(MATHIUS_COLOR_DISPLAY,
                            colorArray[_texture],
                            new Rect((Screen.width/100)*55, (Screen.height/100)*26,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        gui.CreateGUIObject(PLUS1,
                            "+",
                            new Rect((Screen.width/100)*65, (Screen.height/100)*25,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        //Perceptual
        gui.CreateGUIObject(PERCEPTUAL,
                            "Perceptual: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*30,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(PERCEPTUAL_DISPLAY,
                            "",
                            new Rect((Screen.width/100)*55, (Screen.height/100)*31, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            _perceptual);
        //Volume
        gui.CreateGUIObject(VOICE_VOLUME,
                            "Voice Volume: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*34,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS2,
                            "-",
                            new Rect((Screen.width/100)*50, (Screen.height/100)*34,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(VOICE_VOLUME_DISPLAY,
                            soundArray[_sound],
                            new Rect((Screen.width/100)*55, (Screen.height/100)*35,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        gui.CreateGUIObject(PLUS2,
                            "+",
                            new Rect((Screen.width/100)*65, (Screen.height/100)*34,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        //Sound
        gui.CreateGUIObject(SOUND,
                            "Sound: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*38,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MUTE,
                            "Mute: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*42,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MUTE_DISPLAY,
                            "",
                            new Rect((Screen.width/100)*55, (Screen.height/100)*43, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            _mute);
        //Music
        gui.CreateGUIObject(MUSIC,
                            ("Music: " + (Mathf.Round(_music *100f)/100f)),
                            new Rect((Screen.width/100)*20, (Screen.height/100)*46,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MUSIC_DISPLAY,
                            "",
                            new Rect ((Screen.width/100)*50, (Screen.height/100)*47, (Screen.width/100)*20, (Screen.height/100)*2),
                            GUIType.Slider,
                            "",
                            false,
                            0.0f,
                            100.0f,
                            _music);
        //SFX
        gui.CreateGUIObject(EFFECTS,
                            "Effects: " + (Mathf.Round(_sfx*100f)/100f),
                            new Rect((Screen.width/100)*20, (Screen.height/100)*50,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(EFFECTS_DISPLAY,
                            "",
                            new Rect ((Screen.width/100)*50, (Screen.height/100)*51, (Screen.width/100)*20, (Screen.height/100)*2),
                            GUIType.Slider,
                            "",
                            false,
                            0.0f,
                            100.0f,
                            _sfx);
        //Main Menu
        gui.CreateGUIObject(MAIN_MENU,
                            "Main Menu",
                            new Rect(5*(Screen.width/10) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100)) ),
                            GUIType.Button,
                            "box");
        gui.connect(MATHIUS_COLOR,MINUS1,PLUS1,MAIN_MENU,PERCEPTUAL);
        gui.connect(PERCEPTUAL,"","",MATHIUS_COLOR,VOICE_VOLUME);
        gui.connect(VOICE_VOLUME,MINUS2,PLUS2,PERCEPTUAL,MUTE);
        gui.connect(MUTE,"","",VOICE_VOLUME,MUSIC);
        gui.connect(MUSIC,"","",MUTE,EFFECTS);
        gui.connect(EFFECTS,"","",MUSIC,MAIN_MENU);
        gui.connect(MAIN_MENU,"","",EFFECTS,MATHIUS_COLOR);

        gui.connect(MINUS1,"",MATHIUS_COLOR,"","");
        gui.connect(PLUS1,MATHIUS_COLOR,"","","");
        gui.connect(MINUS2,"",VOICE_VOLUME,"","");
        gui.connect(PLUS2,VOICE_VOLUME,"","","");

        gui.pointer = MATHIUS_COLOR;
    }