From 6f3b538704b188152374982e83cbe6efb9339974 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Thu, 21 Nov 2019 14:29:23 -0500 Subject: [PATCH] Fixed a couple of bugs related to instantiating the RadialController component at runtime. --- CHANGELOG.md | 9 +++++++++ .../Assets/RadialController/RadialController.cs | 14 +++++++------- .../RadialControllerWindowsBridge.cs | 4 +++- .../ProjectSettings/ProjectSettings.asset | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73d1988..a0edf07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ # Changelog +## v0.2.2 + +### Date: 11/21/2019 + +### Changes +- Bug Fixes + - Fixed UnityEvents on `RadialController` being null if instanced at runtime. + - Fixed `RadialControllerWindowsBridge.StartServerProcess` not being invoked if the `RadialController` component is instanced at runtime. + ## v0.2.1 ### Date: 11/20/2019 diff --git a/RadialControllerUnity/Assets/RadialController/RadialController.cs b/RadialControllerUnity/Assets/RadialController/RadialController.cs index 5b912c8..5c4da13 100644 --- a/RadialControllerUnity/Assets/RadialController/RadialController.cs +++ b/RadialControllerUnity/Assets/RadialController/RadialController.cs @@ -11,13 +11,13 @@ public class RadialController : MonoBehaviour { public float rotationResolutionInDegrees = 10.0f; public bool useAutoHapticFeedback = true; - public UnityEvent onButtonClicked; - public UnityEvent onButtonPressed; - public UnityEvent onButtonReleased; - public UnityEvent onButtonHolding; - public FloatEvent onRotationChanged; - public UnityEvent onControlAcquired; - public UnityEvent onControlLost; + public UnityEvent onButtonClicked = new UnityEvent(); + public UnityEvent onButtonPressed = new UnityEvent(); + public UnityEvent onButtonReleased = new UnityEvent(); + public UnityEvent onButtonHolding = new UnityEvent(); + public FloatEvent onRotationChanged = new FloatEvent(); + public UnityEvent onControlAcquired = new UnityEvent(); + public UnityEvent onControlLost = new UnityEvent(); private float _prevRotationResolutionInDegrees; private bool _prevUseAutoHapticFeedback; diff --git a/RadialControllerUnity/Assets/RadialController/RadialControllerWindowsBridge.cs b/RadialControllerUnity/Assets/RadialController/RadialControllerWindowsBridge.cs index 7ccd7fb..dbe9502 100644 --- a/RadialControllerUnity/Assets/RadialController/RadialControllerWindowsBridge.cs +++ b/RadialControllerUnity/Assets/RadialController/RadialControllerWindowsBridge.cs @@ -46,7 +46,7 @@ public class RadialControllerWindowsBridge : IRadialControllerPlatformBridge public string Name { get { return "Radial Controller Windows Bridge"; } } - public string Version { get { return "0.2.1"; } } + public string Version { get { return "0.2.2"; } } public event Action onBridgeReady; public event Action onButtonClicked; @@ -64,6 +64,8 @@ public RadialControllerWindowsBridge(RadialController radialController) { _localUdpClient = new LocalUdpClient("RadialControllerUnityReceiver", Port); _localUdpClient.ignoreDataFromClient = true; _localUdpClient.onDataReceived += OnDataReceived; + + StartServerProcess(); } private void StartServerProcess() { diff --git a/RadialControllerUnity/ProjectSettings/ProjectSettings.asset b/RadialControllerUnity/ProjectSettings/ProjectSettings.asset index a04b74f..b706628 100644 --- a/RadialControllerUnity/ProjectSettings/ProjectSettings.asset +++ b/RadialControllerUnity/ProjectSettings/ProjectSettings.asset @@ -120,7 +120,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 0.2.1 + bundleVersion: 0.2.2 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0