The DrawBlip() method
The DrawBlip() method takes the input parameters of the position of the blip (as a Vector2 X, Y pair), and the reference to the RawImage prefab to be created at that location on the radar.
A new GameObject is created (Instantiated) from the prefab, and is parented to the radar GameObject (of which the scripted object is also a component). A reference is retrieved from the Rect Transform of the new RawImage GameObject that has been created for the blip. Calls to the Unity RectTransform method SetInsetAndSizeFromParentEdge(...) result in the blip GameObject being positioned at the provided horizontal and vertical locations over the radar image, regardless of where in the Game panel the background radar image has been ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access