void SetupInputHandler() { GameObject handlerParent = GameObject.Find ("InputHandler"); if (!handlerParent) { handlerParent = new GameObject(); handlerParent.name = "InputHandler"; handlerParent.AddComponent("InputHandler"); handlerParent.transform.parent = transform.parent; } handler = handlerParent.GetComponent<InputHandler>(); handler.RegisterListener (this); }