void Awake() { Instance = this; _actions = ControllerActions.CreateWithDefaultBindings(); InputManager.OnActiveDeviceChanged += OnDeviceChanged; InputManager.OnDeviceDetached += OnDeviceChanged; }
public static string GetKeyBoardType(EControllerBtns e) { var actions = ControllerPc.GetActions(); var btn = actions.Get(e); for (int i = 0; i < btn.Bindings.Count; i++) { var a = btn.Bindings[i]; if (a.BindingSourceType == BindingSourceType.KeyBindingSource) { var text = ((KeyBindingSource)a).Control.ToString(); text = text.ToUpper(); if (text.Contains("NUM ")) { text = text.Replace("NUM ", ""); } if (text.Contains("APE")) { text = text.Replace("APE", ""); } return(text); } } return(""); }
public static Mouse GetMouseType(EControllerBtns e) { var actions = ControllerPc.GetActions(); var btn = actions.Get(e); for (int i = 0; i < btn.Bindings.Count; i++) { var a = btn.Bindings[i]; if (a.BindingSourceType == BindingSourceType.MouseBindingSource) { return(((MouseBindingSource)a).Control); } } return(Mouse.None); }
public static InputControlType GetControlType(EControllerBtns e) { var actions = ControllerPc.GetActions(); var btn = actions.Get(e); for (int i = 0; i < btn.Bindings.Count; i++) { var a = btn.Bindings[i]; if (a.BindingSourceType == BindingSourceType.DeviceBindingSource) { return(((DeviceBindingSource)a).Control); } } Debug.LogError("GetControlType Is None:" + e); return(InputControlType.None); }
public void Init(SpriteRenderer renderer, SlowPoint point, PlayerDeploy deploy) { transform.SetLayer(Layers.Player); Deploy = deploy; SpriteRenderer = renderer; // Material = renderer.material; RedPoint = point; Actions = ControllerPc.GetActions(); _aniStyle = PlayerMoveStyle.Idle; transform.localScale = Vector3.one * deploy.scale; InitRigid(); SupportMgr = new PlayerSupportMgr(); SupportMgr.Init(this); Instance = this; }