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)); }
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)); }
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)); }
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)); }
private AbilitiesTeamHud GetTeamHud(PlayerController controller) { ControllerInputType it = controller.GetInputType(); if (abilitiesTeamA.inputType == it) { return(abilitiesTeamA); } else { return(abilitiesTeamB); } }
public CampTeam GetTeam(ControllerInputType inputType) { TeamManager manager = GetTeamManager(inputType); if (manager != null) { return(manager.team); } else { return(CampTeam.None); } }
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)); }
private TeamManager GetTeamManager(ControllerInputType inputType) { TeamManager manager = null; if (teamMananger1.inputType == inputType) { manager = teamMananger1; } else if (teamMananger2.inputType == inputType) { manager = teamMananger2; } return(manager); }
public static string ToShortCutInput(this ControllerInputType userType) { string result = ""; if (userType == ControllerInputType.Controller1) { result = "P1_"; } else if (userType == ControllerInputType.Controller2) { result = "P2_"; } return(result); }
/// <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)); }