/** * <summary>Highlights the Hotspot based on the mouse cursor's proximity.</summary> * <param name = "isGameplay">If True, then it is during gameplay, and the highlight effect wil work</param> */ public void SetProximity(bool isGameplay) { if (highlight != null) { if (!isGameplay || !IsOn()) { highlight.SetMinHighlight(0f); } else { float amount = (GetIconScreenPosition() - KickStarter.playerInput.GetMousePosition()).magnitude / AdvGame.GetMainGameViewDistance(); if (amount < 0f) { amount = 0f; } else if (amount > 1f) { amount = 1f; } highlight.SetMinHighlight(1f - (amount * KickStarter.settingsManager.highlightProximityFactor)); } } }
/** * <summary>Highlights the Hotspot based on the mouse cursor's proximity.</summary> * <param name = "isGameplay">If True, then it is during gameplay, and the highlight effect wil work</param> */ public void SetProximity(bool isGameplay) { if (highlight != null) { if (gameObject.layer == LayerMask.NameToLayer(KickStarter.settingsManager.deactivatedLayer) || !isGameplay || !IsOn()) { highlight.SetMinHighlight(0f); } else { float amount = (GetIconScreenPosition() - KickStarter.playerInput.GetMousePosition()).magnitude / ACScreen.safeArea.size.magnitude; if (amount < 0f) { amount = 0f; } else if (amount > 1f) { amount = 1f; } highlight.SetMinHighlight(1f - (amount * KickStarter.settingsManager.highlightProximityFactor)); } } }