private void OnDisable() { // When we disable, we just unregister our axis // It also happens before the game object is Destroyed CnInputManager.UnregisterVirtualAxis(_horizintalAxis); CnInputManager.UnregisterVirtualAxis(_verticalAxis); }
private void OnDisable() { SetJoystickOnOrigin(); // When we disable, we just unregister our axis // It also happens before the game object is Destroyed CnInputManager.UnregisterVirtualAxis(HorizintalAxis); CnInputManager.UnregisterVirtualAxis(VerticalAxis); }
private void Update() { if (HorizontalAxisName == "Horizontal1") { if (Player != null) { if (!Player.GetComponent <PlayerController>().enabled) { HorizintalAxis.Value = 0; VerticalAxis.Value = 0; CnInputManager.UnregisterVirtualAxis(HorizintalAxis); CnInputManager.UnregisterVirtualAxis(VerticalAxis); return; } } } if (HorizontalAxisName == "Horizontal2") { if (Player != null) { if (Player.GetComponent <PlayerSkill>().TempCDtime > 0) { Hide(true); } else { Hide(false); } if (Player.GetComponent <GlacierEffect>()) { if (Player.GetComponent <GlacierEffect>().EndTime > 0) { Hide(true); } else if (Player.GetComponent <GlacierEffect>().EndTime <= 0) { Hide(false); } } } } }
private void OnDisable() { // When we disable, we just unregister our axis // It also happens before the game object is Destroyed CnInputManager.UnregisterVirtualAxis(HorizintalAxis); CnInputManager.UnregisterVirtualAxis(VerticalAxis); // When we lift our finger, we reset everything to the initial state _baseTransform.anchoredPosition = _initialBasePosition; _stickTransform.anchoredPosition = _initialStickPosition; _intermediateStickPosition = _initialStickPosition; HorizintalAxis.Value = VerticalAxis.Value = 0f; // We also hide it if we specified that behaviour if (HideOnRelease) { Hide(true); } }
private void OnDisable() { CnInputManager.UnregisterVirtualAxis(_virtualAxis); }