/// <summary> /// Invoke the Initialise in the awake method /// TODO: Move the Intialise into the bridge, hide it /// from Unity completely /// </summary> void Awake() { try { Debug.Log("Creating RadialControllerUnityBridge Instance."); _radialController = RadialControllerUnityBridge.Instance; } catch (Exception e) { Debug.LogErrorFormat("Error while Initialising and configuring RadialControllerUnityBridge: {0}", e.StackTrace); } }
// Use this for initialization void Start() { try { m_controller = RadialControllerUnityBridge.Instance; m_controller.ButtonClicked += controller_ButtonClicked; m_controller.ControlAcquired += controller_ControlAcquired; m_controller.ControlLost += controller_ControlLost; m_controller.RotationChanged += controller_RotationChanged; m_controller.ScreenContactContinued += controller_ScreenContactContinued; m_controller.ScreenContactEnded += controller_ScreenContactEnded; m_controller.ScreenContactStarted += controller_ScreenContactStarted; } catch (Exception e) { Debug.LogErrorFormat("Error while starting Radial Controller event handler. {0}", e.ToString()); } }