I've only spent a few hours with this and just hoping for a silver bullet if anyone else has come across this. Don't bother starting up a new project to test, I'm sure I'll figure it out soon enough.
However, if anyone else has figured this out I would love to hear what you did.
I'm trying to set up a new project with UCC, the New Input System (I do not have the old one installed because I'd rather just get it working completely) and Dialogue System. I am using the default CharacterInput from the integration package - I did add Fire1 to test button press (discussed below).
I have the player set up fine and they are able to trigger a conversation fine. The problem is that when it comes to clicking on the button with the mouse there is no input passed through. The button doesn't change colour when selected, there is just no response. I did do a test and added a UIButtonkeyTrigger to the response button and set it to "Fire1" and then added "InputDeviceManager.RegisterInputAction("Fire1", controls.UI.Fire1);" to the RegisterMyControl script and that worked, the button press was sucessful and the conversation carried on.
So, basically, it's just mouse cursor that is not sending a message. I should add that on the UnityInputSystem component I have a State that enables the Cursor by setting "Disable Cursor"to false - like with the basic input system. Can anyone think of what I'm missing or doing wrong?
And the RegisterMyControls script
Code: Select all
using UnityEngine;
using UnityEngine.InputSystem;
using PixelCrushers;
public class RegisterMyControls : MonoBehaviour // Add me to Dialogue Manager.
{
protected static bool isRegistered = false;
private bool didIRegister = false;
private CharacterInput controls;
void Awake()
{
controls = new CharacterInput();
}
void OnEnable()
{
if (!isRegistered)
{
isRegistered = true;
didIRegister = true;
controls.Enable();
InputDeviceManager.RegisterInputAction("Submit", controls.UI.Submit);
InputDeviceManager.RegisterInputAction("Cancel", controls.UI.Cancel);
InputDeviceManager.RegisterInputAction("Fire1", controls.UI.Fire1);
}
}
void OnDisable()
{
if (didIRegister)
{
isRegistered = false;
didIRegister = false;
controls.Disable();
InputDeviceManager.UnregisterInputAction("Submit");
InputDeviceManager.UnregisterInputAction("Cancel");
InputDeviceManager.UnregisterInputAction("Fire1");
}
}
}
Nathan