Example #1
0
        private void OnEnable()
        {
            enabled = true;
            _bridge = PlatformBridgeFactory.CreateBridge(this);

            if (_bridge != null)
            {
                Debug.LogFormat("[RadialController] Created platform bridge: {0} {1}.", _bridge.Name, _bridge.Version);

                _bridge.onBridgeReady     += OnBridgeReady;
                _bridge.onButtonClicked   += OnButtonClicked;
                _bridge.onButtonPressed   += OnButtonPressed;
                _bridge.onButtonReleased  += OnButtonReleased;
                _bridge.onButtonHolding   += OnButtonHolding;
                _bridge.onRotationChanged += OnRotationChanged;
                _bridge.onControlAcquired += OnControlAcquired;
                _bridge.onControlLost     += OnControlLost;

                CheckRotationResolutionInDegrees(true);
                CheckUseAutoHapticFeedback(true);
            }
            else
            {
                Debug.LogWarningFormat("[RadialController] Current platform does not have a bridge implemented. Radial Controller will not be usable.");
            }
        }
Example #2
0
 private void OnDisable()
 {
     if (_bridge != null)
     {
         Debug.LogFormat("[RadialController] Disposing of platform bridge: {0}", _bridge.Name);
         _bridge.Dispose();
         _bridge = null;
     }
 }