Esempio n. 1
0
    void Fire(bool state)
    {
        if (GuiHUD.Instance.CommandMenu != null && GuiHUD.Instance.CommandMenu.IsMenuVisible)
        {
            GuiHUD.Instance.CommandMenu.ConfirmMouseSelection();
            return;
        }

        //podle toho ve kterem jsem modu (USE/combat), zavolam delagata na strelbu nebo na use.
        if (null != Player.LocalInstance && Player.LocalInstance.InUseMode)
        {
            if (state == true)
            {
                States.UseDelegate();
            }
        }
        else
        {
            if (state == true)
            {
                States.FireDownDelegate();
                m_IsFiring = true;
            }
            else
            {
                States.FireUpDelegate();
                m_IsFiring = false;
            }
        }
    }
Esempio n. 2
0
 void OnFireDown()
 {
     //fire only when there is no use
     if (Player.LocalInstance.InUseMode)
     {
         States.UseDelegate();
     }
     else
     {
         States.FireDownDelegate();
     }
 }
Esempio n. 3
0
 private void Fire(bool state)
 {
     if (Player.LocalInstance.InUseMode)
     {
         if (state == true)
         {
             States.UseDelegate();
         }
     }
     else
     {
         if (state == true)
         {
             States.FireDownDelegate();
         }
         else
         {
             States.FireUpDelegate();
         }
     }
 }
    void UpdateActionsBlueTooth()
    {
        //ovladani tlacitky
        //Fire:
        if (Input.GetKeyDown("8"))
        {
            //fire only when there is no use
            if (Player.LocalInstance.InUseMode)
            {
                States.UseDelegate();
            }
            else
            {
                States.FireDownDelegate();
            }
        }

        if (Input.GetKeyUp("8"))
        {
            //delegate up event only for fire
            if (Player.LocalInstance.InUseMode == false)
            {
                States.FireUpDelegate();
            }
        }

        //reload
        if (Input.GetKeyDown("7"))
        {
            States.ReloadDelegate();
        }

        //roll
        if (Input.GetKeyDown("6"))
        {
            States.RollDelegate();
        }

        //items
        if (Input.GetKeyDown("3"))
        {
            ChangeItem(0);
        }
        else if (Input.GetKeyDown("4"))
        {
            ChangeItem(1);
        }
        else if (Input.GetKeyDown("2"))
        {
            ChangeItem(2);
        }

        //weapons
        if (Input.GetKeyDown("a"))
        {
            ChangeWeapon(0);
        }
        else if (Input.GetKeyDown("w"))
        {
            ChangeWeapon(1);
        }
        else if (Input.GetKeyDown("d"))
        {
            ChangeWeapon(2);
        }
    }
    void UpdateActions()
    {
        if (ButtonDown(E_Input.Fire))
        {
            //fire only when there is no use
            if (Player.LocalInstance.InUseMode)
            {
                States.UseDelegate();
            }
            else
            {
                States.FireDownDelegate();
            }
        }

        if (ButtonUp(E_Input.Fire))
        {
            //delegate up event only for fire
            if (Player.LocalInstance.InUseMode == false)
            {
                States.FireUpDelegate();
            }
        }

        if (ButtonDown(E_Input.Reload) /* || Input.GetKeyDown("7")*/)         //JV FIX
        {
            States.ReloadDelegate();
        }

        if (ButtonDown(E_Input.Sprint))
        {
            States.SprintDownDelegate();
        }

        if (ButtonUp(E_Input.Sprint))
        {
            States.SprintUpDelegate();
        }

        if (ButtonDown(E_Input.Roll))
        {
            States.RollDelegate();
        }

        //FIX chyby na androidu - device obcas hlasi spatne escape stav kdyz delame multi touch
        bool escapeKeyPressed = Input.GetKeyUp("escape") && (Time.timeSinceLevelLoad > LastTouchControlTime + 0.25f);

        if ((ButtonDown(E_Input.Pause) || escapeKeyPressed))
        {
            if (MFGuiFader.Fading == false && GuiFrontendIngame.PauseMenuCooldown() == false)
            {
                GuiFrontendIngame.ShowPauseMenu();
            }
        }

        if (ButtonDown(E_Input.Item1))
        {
            ChangeItem(0);
        }
        else if (ButtonDown(E_Input.Item2))
        {
            ChangeItem(1);
        }
        else if (ButtonDown(E_Input.Item3))
        {
            ChangeItem(2);
        }

        if (ButtonDown(E_Input.Weapon1))
        {
            ChangeWeapon(0);
        }
        else if (ButtonDown(E_Input.Weapon2))
        {
            ChangeWeapon(1);
        }
        else if (ButtonDown(E_Input.Weapon3))
        {
            ChangeWeapon(2);
        }

        if (ButtonDown(E_Input.WeaponNext))
        {
            ChangeWeaponNext();
        }
        else if (ButtonDown(E_Input.WeaponPrev))
        {
            ChangeWeaponPrev();
        }

        /*if(ButtonDown(E_Input.Voicechat))
         * {
         *      if(Client.Instance)
         *              Client.Instance.SetVoiceChat(true);
         * }
         * else if (ButtonUp(E_Input.Voicechat))
         * {
         *      if(Client.Instance)
         *              Client.Instance.SetVoiceChat(false);
         * }*/
    }