Пример #1
0
        public static float GetAxisVertical1(ControllerInputType userType)
        {
            if (userType == ControllerInputType.ControllerCPU)
            {
                return(0);
            }
            string str_input_v = userType.ToShortCutInput() + "Vertical1";

            return(Input.GetAxis(str_input_v));
        }
Пример #2
0
        public static bool GetButtonUp(ControllerInputType userType, ButtomInputType bt)
        {
            if (userType == ControllerInputType.ControllerCPU)
            {
                return(false);
            }
            string str_input = userType.ToShortCutInput() + bt.ToString();

            return(Input.GetButtonUp(str_input));
        }
Пример #3
0
        public static bool GetButtonDown(ControllerInputType userType, string bt)
        {
            if (userType == ControllerInputType.ControllerCPU)
            {
                return(false);
            }
            string str_input = userType.ToShortCutInput() + bt;

            return(Input.GetButtonDown(str_input));
        }
Пример #4
0
        public static float GetAxisHorizontal2(ControllerInputType userType)
        {
            if (userType == ControllerInputType.ControllerCPU)
            {
                return(0);
            }
            string str_input_h = userType.ToShortCutInput() + "Horizontal2";

            return(Input.GetAxis(str_input_h));
        }
Пример #5
0
    private AbilitiesTeamHud GetTeamHud(PlayerController controller)
    {
        ControllerInputType it = controller.GetInputType();

        if (abilitiesTeamA.inputType == it)
        {
            return(abilitiesTeamA);
        }
        else
        {
            return(abilitiesTeamB);
        }
    }
Пример #6
0
    public CampTeam GetTeam(ControllerInputType inputType)
    {
        TeamManager manager = GetTeamManager(inputType);

        if (manager != null)
        {
            return(manager.team);
        }
        else
        {
            return(CampTeam.None);
        }
    }
Пример #7
0
        public static Vector2 GetAxis2(ControllerInputType userType)
        {
            if (userType == ControllerInputType.ControllerCPU)
            {
                return(Vector2.zero);
            }
            string str_input_h = userType.ToShortCutInput() + "Horizontal2";
            string str_input_v = userType.ToShortCutInput() + "Vertical2";
            float  h           = Input.GetAxis(str_input_h);
            float  v           = Input.GetAxis(str_input_v);

            return(new Vector2(h, v));
        }
Пример #8
0
    private TeamManager GetTeamManager(ControllerInputType inputType)
    {
        TeamManager manager = null;

        if (teamMananger1.inputType == inputType)
        {
            manager = teamMananger1;
        }
        else if (teamMananger2.inputType == inputType)
        {
            manager = teamMananger2;
        }

        return(manager);
    }
Пример #9
0
        public static string ToShortCutInput(this ControllerInputType userType)
        {
            string result = "";

            if (userType == ControllerInputType.Controller1)
            {
                result = "P1_";
            }
            else if (userType == ControllerInputType.Controller2)
            {
                result = "P2_";
            }

            return(result);
        }
Пример #10
0
 /// <summary>
 /// Pesquisa time para o qual o controlador pertence. tenha em mente que NONE pode ser retornado caso o controlador nao
 /// tenha nenhum time vinculado a aele
 /// </summary>
 /// <param name="inputType">Entrada de controle</param>
 /// <returns>Time vinculado ou NONE</returns>
 public static CampTeam GetTeam(this ControllerInputType inputType)
 {
     return(GameManager.instance.GetTeam(inputType));
 }