当前位置: 首页>>代码示例>>C#>>正文


C# GUIManager.CreateGUIObject方法代码示例

本文整理汇总了C#中GUIManager.CreateGUIObject方法的典型用法代码示例。如果您正苦于以下问题:C# GUIManager.CreateGUIObject方法的具体用法?C# GUIManager.CreateGUIObject怎么用?C# GUIManager.CreateGUIObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GUIManager的用法示例。


在下文中一共展示了GUIManager.CreateGUIObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

    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),
//.........这里部分代码省略.........
开发者ID:RandomNPC,项目名称:Mathius_DOE,代码行数:101,代码来源:LevelEditorUI.cs

示例2: Start

    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;
    }
开发者ID:RandomNPC,项目名称:Mathius_DOE,代码行数:52,代码来源:Menu_UI.cs

示例3: Start

    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;
    }
开发者ID:RandomNPC,项目名称:Mathius_DOE,代码行数:23,代码来源:CreditsUI.cs

示例4: Start

    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
//.........这里部分代码省略.........
开发者ID:RandomNPC,项目名称:Mathius_DOE,代码行数:101,代码来源:GameOverUI.cs

示例5: Start

    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;
    }
开发者ID:RandomNPC,项目名称:Mathius_DOE,代码行数:71,代码来源:HighScoreUI.cs

示例6: Start

    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),
//.........这里部分代码省略.........
开发者ID:RandomNPC,项目名称:Mathius_DOE,代码行数:101,代码来源:OptionsUI.cs


注:本文中的GUIManager.CreateGUIObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。