- Unity 2018 Cookbook(Third Edition)
- Matt Smith
- 99字
- 2025-02-23 18:56:38
The Start() method
The Start() method first caches a reference to the Raw Image of the radar background image. Then it caches a reference to the Transform component of the player's character (tagged as Player). This allows the scripted object to know about the position of the Player's character in each frame. Next, the width and height of the radar image are cached – so, the relative positions for blips can be calculated, based on the size of this background radar image. Finally, the size of each blip (blipWidth and blipHeight) is calculated, using the blipSizePercentage public variable.