public void SetHapticViewState() { Debug.Log("button is clicked"); if (mHapticView != null) { if (mHapticView.IsActive()) { mHapticView.Deactivate(); Debug.Log("Haptic is deactivated"); //hapticOnOffButton.GetComponent<Image>().sprite = hapticsOff; //hapticViewStateText.text = "Activate Haptics"; } else { mHapticView.Activate(); Debug.Log("Haptic is activated"); //hapticOnOffButton.GetComponent<Image>().sprite = hapticsOn; //hapticViewStateText.text = "Deactivate Haptics"; } } }