Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeatureUiMarker.cs problem #861

Closed
willychang21 opened this issue Jun 12, 2018 · 1 comment
Closed

FeatureUiMarker.cs problem #861

willychang21 opened this issue Jun 12, 2018 · 1 comment

Comments

@willychang21
Copy link

I want to create a UI marker on my map like this ↓
marker-15
Hence,I try to modify the FeatureUiMarker.cs
I create the landmark to show the UI marker

[SerializeField]
private Transform _landmark;

image
image
↑ I don't know how create the object like Rectangle & Info
Because the FeatureUiMarker.cs only give the _wrapperMarker.position & _infoPanel.position

FeatureUiMarker.cs

_wrapperMarker.position = new Vector2(left - 10, top + 10);
(_wrapperMarker as RectTransform).sizeDelta = new Vector2(right - left + 20, top - bottom + 20);
_infoPanel.position = new Vector2(right + 10, top + 10);
_info.text = string.Join(" \r\n ", _selectedFeature.Feature.Properties.Select(x => x.Key + " - " + x.Value.ToString()).ToArray());

But ObjectInspectorModifier.cs only create InteractiveSelectionCanvas & selector

ObjectInspectorModifier.cs

var go = new GameObject("InteractiveSelectionCanvas", typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster));
canvas = go.GetComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;

var sel = Instantiate(Resources.Load<GameObject>("selector"));
sel.transform.SetParent(canvas.transform);
_marker = sel.GetComponent<FeatureUiMarker>();

I have no idea about this ??:confused:
What did I miss???:sob::sob::sob:

@willychang21
Copy link
Author

haha I find the selector object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant