Other: I was able to fix it myself.
Update not updating and inherits from MonoBehaviour
EDIT: Fixed. I forgot to add the handler for registering the input. Works now. :)
Hi everyone, I need a little help.
I wrote a class with XInputDotNetPure active. My class is set on a GameObject, said object is active and it inherits from MonoBehaviour. Problem is, the code inside will not execute. So I had to delete it and wrote a simple variable update and a Debug.Log call. And even that won't work. Here's the code:
using UnityEngine;
using System.Collections;
using XInputDotNetPure;
public class Title_GoToNext : MonoBehaviour {
// For the class itself.
public Animator titleAnim;
public int htpTime;
public AudioSource audioS;
// XInput-related.
public int activePads = 0;
public GamePadState temp;
public PlayerIndex plyrIndex;
public GamePadState[] states = new GamePadState[4];
public GamePadState previous;
// Use this for initialization
void Start () {
titleAnim = GetComponent<Animator>();
htpTime = 0;
audioS = GetComponent<AudioSource>();
}
// Update is called once per frame
void Update() {
++htpTime;
Debug.Log(htpTime.ToString());
}
}
Follow this Question
Related Questions
EditorGUILayout.ObjectField and array 0 Answers
Performance question: Is it better to Instantiate particle systems OR use same particle system? 1 Answer
Creating a Game Over after a Trigger/Event 1 Answer
Button calls itself numerous times 0 Answers
C# Expression denotes a 'value', where a 'method group' was expected 1 Answer