// protected override void OnMarkerRemove(MapMarker marker) { // } // protected override void OnMarkerAdd(MapMarker marker) { marker.ShowMessage(false); marker.ShowDistance(false); marker.ShowDirectionals(!UIMaps.RegisteredObjectIsPlayer(marker.uIRegisteredObject)); marker.showRotation = false; }
static void InitializeUIManager() { UIMaps.InitializeMaps(); eventSystem.sendNavigationEvents = true; inputModule.gameObject.SetActive(false); SaveLoad.onSettingsOptionsLoaded += OnSettingsOptionsLoaded; SaveLoad.onSaveSettingsOptions += OnSaveSettingsOptions; }
public void RegisterWithUI() { registeredUIObj = UIMaps.RegisterStaticObjectWithUI(registerKey, transform.position, transform.forward, message, miniMapIconName, mainMapIconName, compassIconName, worldViewIconName, true); registeredUIObj.ShowMapType(UIMapsObject.ShowType.MainMap, true); // if we're registered with ui throug this script, it means we've loaded locally // so add to the mini map / compass registeredUIObj.ShowMapType(UIMapsObject.ShowType.MiniMap, true); registeredUIObj.ShowMapType(UIMapsObject.ShowType.Compass, true); }
void OnEnable() { if (registerOnEnable) { RegisterWithUI(); } else { // check if we're alreaady registered anyways if (UIMaps.StaticObjectRegistered(registerKey, out registeredUIObj)) { RegisterWithUI(); } } }
void RegisterWithUI() { registeredUIObj = UIMaps.RegisterDynamicObjectWithUI(gameObject.name, GetInstanceID(), transform.position, transform.forward, message, miniMapIconName, mainMapIconName, compassIconName, worldViewIconName); registeredUIObj.SetWorldPositionGetter(() => transform.position); registeredUIObj.SetWorldForwardGetter(() => transform.forward); }
public void DeregisterWithUI() { registeredUIObj = UIMaps.DeregisterDynamicObjectWithUI(GetInstanceID()); }
public void DeregisterWithUI() { registeredUIObj = UIMaps.DeregisterStaticObjectWithUI(registerKey); }
void AddWaypoint(float zOffset) { if (defaultWaypointRegisteredObj == null && currentWaypointRegisterObj == null) { // if (currentWaypointMarker != null) { // TODO: Get ground Y if (selectedMarker == null || UIMaps.RegisteredObjectIsPlayer(selectedMarker.uIRegisteredObject)) { Vector3 worldPos = Vector3.zero; Vector2 wPos = (move);// + Vector2.one * zOffset);// * mapSize; Debug.LogError(wPos); worldPos.x = mapCenter.x + wPos.x * mapRadius * 2; worldPos.z = mapCenter.y + wPos.y * mapRadius * 2; Debug.LogError(worldPos); // register the default empty icon defaultWaypointRegisteredObj = UIMaps.RegisterDynamicObjectWithUI( "MapWaypoint", GetInstanceID(), worldPos, Vector3.forward, "Waypoint", null, null, null, null ); defaultWaypointRegisteredObj.SetAsWaypoint(true); defaultWaypointRegisteredObj.ShowMapType(UIMapsObject.ShowType.MainMap, true); defaultWaypointRegisteredObj.ShowMapType(UIMapsObject.ShowType.MiniMap, true); defaultWaypointRegisteredObj.ShowMapType(UIMapsObject.ShowType.Compass, true); defaultWaypointRegisteredObj.ShowMapType(UIMapsObject.ShowType.ScreenMap, true); } else { // Debug.Log("making waypoing already thtere"); currentWaypointRegisterObj = selectedMarker.uIRegisteredObject; // worldPos = selectedMarker.GetMarkerPosition(); currentWaypointRegisterObj.SetAsWaypoint(true); // alraedy showing map... // currentWaypointMarker.uIRegisteredObject.ShowMainMap(true); currentWaypointRegisterObj.ShowMapType(UIMapsObject.ShowType.MiniMap, true); currentWaypointRegisterObj.ShowMapType(UIMapsObject.ShowType.Compass, true); currentWaypointRegisterObj.ShowMapType(UIMapsObject.ShowType.ScreenMap, true); // currentWaypointMarker = AddMapMarker ("MapWaypoint", GetInstanceID(), waypointIcon, () => worldPos, "Waypoint"); } } else { if (currentWaypointRegisterObj != null) { currentWaypointRegisterObj.SetAsWaypoint(false); currentWaypointRegisterObj.ShowMapType(UIMapsObject.ShowType.ScreenMap, false); if (!currentWaypointRegisterObj.loadedLocally) { currentWaypointRegisterObj.ShowMapType(UIMapsObject.ShowType.MiniMap, false); currentWaypointRegisterObj.ShowMapType(UIMapsObject.ShowType.Compass, false); } currentWaypointRegisterObj = null; } // else { // } if (defaultWaypointRegisteredObj != null) { defaultWaypointRegisteredObj = UIMaps.DeregisterDynamicObjectWithUI(GetInstanceID()); } // currentWaypointMarker = null; // defaultWaypointRegisteredObj = null; // RemoveMapMarker(GetInstanceID()); // currentWaypointMarker = null; } }