//Enables the Marker. Must be public void EnableMarker() { if (minimapManager == null) { minimapManager = FindObjectOfType <MinimapManager>(); } if (marker != null) { if (!marker.isActiveAndEnabled) { marker.gameObject.SetActive(true); } if (!_init) { marker = Instantiate(marker); marker.Initialize(targetTransform); minimapManager.AddNewMarker(marker, objectType); marker.SetFollow(shouldFollow); _init = true; } else { minimapManager.ResetMarkerSprite(marker); } if (markerSprite != null && objectType == TYPE.UNIQUE) { marker.SetSprite(markerSprite); } } }
//Resets Marker sprite to Default TYPE sprite public void ResetMarkerSprite(MinimapMarker p_marker) { switch (p_marker.GetMarkerType()) { case TYPE.PLAYER: p_marker.SetSprite(playerSprite); break; case TYPE.ALLY: p_marker.SetSprite(allySprite); break; case TYPE.ENEMY: p_marker.SetSprite(enemySprite); break; } p_marker.SetFollow(true); }
//Set Death Sprite for marker public void MarkerDied(MinimapMarker p_marker) { switch (p_marker.GetMarkerType()) { case TYPE.PLAYER: p_marker.SetSprite(playerDeathSprite); break; case TYPE.ALLY: p_marker.SetSprite(allyDeathSprite); break; case TYPE.ENEMY: p_marker.SetSprite(enemyDeathSprite); break; } p_marker.SetFollow(false); }
public void ShouldFollow(bool p_follow) { shouldFollow = p_follow; marker.SetFollow(p_follow); }