public static void SetMarkerActive(this HUDNavigationElement element, NavigationElementType elementType, bool value) { // get marker gameobject GameObject markerGO = null; switch (elementType) { case NavigationElementType.Radar: markerGO = element.Radar.gameObject; break; case NavigationElementType.CompassBar: markerGO = element.CompassBar.gameObject; break; case NavigationElementType.Minimap: markerGO = element.Minimap.gameObject; break; default: break; } // set marker gameobject active/inactive if (markerGO != null) { // only update if value has changed if (value != markerGO.activeSelf) { // invoke events if (value) // appeared { element.OnAppear.Invoke(element, elementType); } else // disappeared { element.OnDisappear.Invoke(element, elementType); } // set active state markerGO.gameObject.SetActive(value); } } }
public static void SetMarkerPosition(this HUDNavigationElement element, NavigationElementType elementType, Vector3 markerPos, RectTransform parentRect = null) { if (elementType == NavigationElementType.Radar) { // set radar marker position if (element.RadarMarker != null) { element.RadarMarker.rectTransform.localPosition = markerPos; } } else if (elementType == NavigationElementType.CompassBar) { // set compass bar marker position if (element.CompassBarMarker != null) { element.CompassBarMarker.transform.position = new Vector3(markerPos.x + parentRect.localPosition.x, parentRect.position.y, 0f); } } }
public static float GetIconRadius(this HUDNavigationElement element, NavigationElementType elementType) { float radius = (elementType == NavigationElementType.Radar) ? element.Radar.PrefabRect.sizeDelta.x : element.Minimap.PrefabRect.sizeDelta.x; return(radius / 2f); }
public void OnElementAppeared(NavigationElementType type) { // Debug.LogFormat ("{0} element appeared.", type); }
public void OnElementLeaveRadius(NavigationElementType type) { // Debug.LogFormat ("{0} element left radius.", type); }
public void OnElementEnterRadius(NavigationElementType type) { // Debug.LogFormat ("{0} element entered radius.", type); }
public void OnElementLeaveRadius(HUDNavigationElement element, NavigationElementType type) { Debug.LogFormat("{0} element of {1} left radius.", type, element.name); }
public void OnElementEnterRadius(HUDNavigationElement element, NavigationElementType type) { Debug.LogFormat("{0} element of {1} entered radius.", type, element.name); }
public void OnElementDisappeared(HUDNavigationElement element, NavigationElementType type) { Debug.LogFormat("{0} element of {1} disappeared.", type, element.name); }
public static string ConvertNavigationElementTypeToDisplayedString(NavigationElementType type) { switch (type) { //add other elements from right site navigation if necessary case NavigationElementType.ClosurePageTab: return "Closure page tab"; case NavigationElementType.FormpageTab: return "Formpage tab"; case NavigationElementType.ExternalLinkTab: return "External link tab"; case NavigationElementType.ForgotPasswordPageTab: return "Forgot password page tab"; case NavigationElementType.LoginPageTab: return "Login page tab"; case NavigationElementType.ResetPasswordPageTab: return "Reset password page tab"; case NavigationElementType.UnsubscribeClosurePageTab: return "Unsubscribe closure page tab"; default: return "Unsubscribe page tab"; } }
public static string ConvertToNavigationElementType(NavigationElementType navigationElementType) { switch (navigationElementType) { case NavigationElementType.ClickableHeadline: return "ch"; case NavigationElementType.Divider: return "di"; case NavigationElementType.Link: return "li"; case NavigationElementType.NonClickableHeadline: return "nh"; case NavigationElementType.FormpageTab: return "ft"; case NavigationElementType.ClosurePageTab: return "ct"; case NavigationElementType.ForgotPasswordPageTab: return "fp"; case NavigationElementType.LoginPageTab: return "lt"; case NavigationElementType.ResetPasswordPageTab: return "rt"; case NavigationElementType.UnsubscribeClosurePageTab: return "uc"; case NavigationElementType.UnsubscribePageTab: return "ut"; default: return "et"; } }