public void FillUserForm(string initial, string middleName, string firstName)
        {
            InputInitial.EnterText(initial);
            InputFirstName.EnterText(firstName);
            InputMiddleName.EnterText(middleName);
            btnSave.Clicks();

            /*
             * SeleniumSetMethods.EnterText(InputInitial, initial);
             * SeleniumSetMethods.EnterText(InputFirstName, firstName);
             * SeleniumSetMethods.EnterText(InputMiddleName, middleName);
             * SeleniumSetMethods.Click(btnSave);
             *
             * /
             * /*
             * InputInitial.SendKeys(initial);
             * InputFirstName.SendKeys(firstName);
             * InputMiddleName.SendKeys(middleName);
             *
             * btnSave.Click();
             */
        }
示例#2
0
 void Update()
 {
     if(Input.GetKeyDown(KeyCode.W)){//up
         switch(_state){
             case State.INPUT:
                 guiInput.swipe(Direction.Up);
                 switch(guiInput.pointer){
                     case UP1:
                     case UP2:
                     case UP3:
                         guiInput.selectOption(guiInput.pointer);
                         break;
                     default:
                         break;
                 }
                 break;
             case State.DISPLAY:
                 guiDisplay.swipe(Direction.Up);
                 break;
             default:
                 break;
         }
     }
     if(Input.GetKeyDown(KeyCode.A)){//left
         switch(_state){
             case State.INPUT:
                 guiInput.swipe(Direction.Left);
                 if(_initial != InputInitial.NONE) _hsi.swipe(SwipeDirection.Left);
                 break;
             case State.DISPLAY:
                 guiDisplay.swipe(Direction.Left);
                 break;
             default:
                 break;
         }
     }
     if(Input.GetKeyDown(KeyCode.S)){//down
         switch(_state){
             case State.INPUT:
                 guiInput.swipe(Direction.Down);
                 switch(guiInput.pointer){
                     case DOWN1:
                     case DOWN2:
                     case DOWN3:
                         guiInput.selectOption(guiInput.pointer);
                         break;
                     default:
                         break;
                 }
                 break;
             case State.DISPLAY:
                 guiDisplay.swipe(Direction.Down);
                 break;
             default:
                 break;
         }
     }
     if(Input.GetKeyDown(KeyCode.D)){//right
         switch(_state){
             case State.INPUT:
                 guiInput.swipe(Direction.Right);
                 if(_initial != InputInitial.NONE) _hsi.swipe(SwipeDirection.Right);
                 break;
             case State.DISPLAY:
                 guiDisplay.swipe(Direction.Right);
                 break;
             default:
                 break;
         }
     }
     if(Input.GetKeyDown(KeyCode.Return)){//select
         switch(_state){
             case State.INPUT:
                 guiInput.selectOption(guiInput.pointer);
                 break;
             case State.DISPLAY:
                 guiDisplay.selectOption(guiDisplay.pointer);
                 break;
             default:
                 break;
         }
     }
     switch(guiInput.pointer){
         case UP1:
         case DOWN1:
             _initial = InputInitial.ONE;
             break;
         case UP2:
         case DOWN2:
             _initial = InputInitial.TWO;
             break;
         case UP3:
         case DOWN3:
             _initial = InputInitial.THREE;
             break;
         default:
             _initial = InputInitial.NONE;
             break;
     }
 }
示例#3
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;
    }
示例#4
0
    void HandlePconGesturePerformed(object sender, PCGesture e)
    {
        switch(e.gesture){
            case Gesture.LEFT:
                switch(_state){
                    case State.INPUT:
                        guiInput.swipe(Direction.Left);
                        break;
                    case State.DISPLAY:
                        guiDisplay.swipe(Direction.Left);
                        break;
                    default:
                        break;
                }
                break;
            case Gesture.RIGHT:
                switch(_state){
                    case State.INPUT:
                        guiInput.swipe(Direction.Right);
                        break;
                    case State.DISPLAY:
                        guiDisplay.swipe(Direction.Right);
                        break;
                    default:
                        break;
                }
                break;
            case Gesture.UP:
                switch(_state){
                    case State.INPUT:
                        guiInput.swipe(Direction.Up);
                        switch(guiInput.pointer){
                            case UP1:
                            case UP2:
                            case UP3:
                                guiInput.selectOption(guiInput.pointer);
                                break;
                            default:
                                break;
                        }
                        break;
                    case State.DISPLAY:
                        guiDisplay.swipe(Direction.Up);
                        break;
                    default:
                        break;
                }
                break;
            case Gesture.DOWN:
                switch(_state){
                    case State.INPUT:
                        guiInput.swipe(Direction.Down);
                        switch(guiInput.pointer){
                            case DOWN1:
                            case DOWN2:
                            case DOWN3:
                                guiInput.selectOption(guiInput.pointer);
                                break;
                            default:
                                break;
                        }
                        break;
                    case State.DISPLAY:
                        guiDisplay.swipe(Direction.Down);
                        break;
                    default:
                        break;
                }
                break;
            case Gesture.SELECT:
                switch(_state){
                    case State.INPUT:
                        guiInput.selectOption(guiInput.pointer);
                        break;
                    case State.DISPLAY:
                        guiDisplay.selectOption(guiDisplay.pointer);
                        break;
                    default:
                        break;
                }
                break;
            default:
                break;
        }

        switch(guiInput.pointer){
            case UP1:
            case DOWN1:
                _initial = InputInitial.ONE;
                break;
            case UP2:
            case DOWN2:
                _initial = InputInitial.TWO;
                break;
            case UP3:
            case DOWN3:
                _initial = InputInitial.THREE;
                break;
            default:
                _initial = InputInitial.NONE;
                break;
        }
    }