Пример #1
0
    public void TogglePause()
    {
        ActorInputHandler inputHandler = brain as ActorInputHandler;

        if (inputHandler == null)
        {
            return;
        }

        menuActive = !menuActive;

        if (menuActive)
        {
            Session.ChangeMenu(Menu.Menus.Pause);
            Input.SetMouseMode(Input.MouseMode.Visible);
        }
        else
        {
            Session.ChangeMenu(Menu.Menus.HUD);
            Input.SetMouseMode(Input.MouseMode.Captured);
        }
    }
Пример #2
0
 /* 0 No AI
   *  1-4 Input routine + initialize HUD
   *  >4 Initialize AI module
   */
 void AssignPlayer(int player)
 {
     playerNumber = player;
     if(arms.Empty()){
       arms.EquipAbility(Item.GetItem("Abilities/Unarmed"));
     }
     StartCoroutine(RegenRoutine());
     if(player <5 && player > 0){
       SetMenuOpen(false);
       if(menu){ menu.Change("HUD");  menu.actor = this; }
       if(Session.session != null && cam != null){
     Session.session.RegisterPlayer(this, player, cam);
       }
       else{ print("Session or cam is null"); }
       if(player == 1){ input = new ActorInputHandler(this, "KEYBOARD AND MOUSE"); }
       else{ input = new ActorInputHandler(this, "XBOX 360 CONTROLLER"); }
       StartCoroutine(InputRoutine());
     }
     else if(player == 5){
       if(defaultAI == ""){ ai = new AIManager(this, "PASSIVE"); }
       else{ ai = new AIManager(this, defaultAI); }
       if(speechTreeFile != ""){ speechTree = new SpeechTree(speechTreeFile); }
     }
 }