protected void OnUpdateBindingDisplay(RebindActionUI component, string bindingDisplayString, string deviceLayoutName, string controlPath) { if (string.IsNullOrEmpty(deviceLayoutName) || string.IsNullOrEmpty(controlPath)) { return; } var icon = default(Sprite); if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "DualShockGamepad")) { icon = ps4.GetSprite(controlPath); } else if (InputSystem.IsFirstLayoutBasedOnSecond(deviceLayoutName, "Gamepad")) { icon = xbox.GetSprite(controlPath); } var textComponent = component.bindingText; // Grab Image component. var imageGO = textComponent.transform.parent.Find("ActionBindingIcon"); var imageComponent = imageGO.GetComponent <Image>(); if (icon != null) { textComponent.gameObject.SetActive(false); imageComponent.sprite = icon; imageComponent.gameObject.SetActive(true); } else { textComponent.gameObject.SetActive(true); imageComponent.gameObject.SetActive(false); } }
// Update is called once per frame public void RebindingEventStart(RebindActionUI component, InputActionRebindingExtensions.RebindingOperation rebindingOperation) { Debug.Log("RebindingEventStart"); }