PlayerControl Start¶
PlayerControl's start contains minimal initialisation logic:
- MainManager.
playeris set to this which assigns the PlayerControl singleton for the rest of the game to use entityis set to the EntityControl of this GameObject- tag is set to
Playerwith a layer of 11 (Player) flycooldownset to 240.0- entity gets CreateDetector called which adds a wall detector using a BoxCollider with size (0.35, 0.6, 0.1) and center (0.0, 0.75,
ccolradius + 0.1) - entity.
speedset tobasespeedwhich should always be 5 - entity.
rigidmass is set to 0.01 npcis reset to a new empty list- entity.
overridejumpis set to false bubbleshieldis initialised to be an instance ofPrefabs/Objects/BubbleShieldchilded to the entity.rotaterwith a local position of (0.5, 1.25, 0.0) and scale of Vector3.zerodigiconis set to 2 elements to form the UI whendigging(either are initially disabled using thespritedefaultunitymaterial on layer 15 which is3DUI):- 0: A new sprite object childed to this GameObject locally positioned at 0.5 in y using the
guisprites[3]sprite (down arrow) with a scale of (0.35, 2.0, 1.0) - 1: A new sprite object childed to
digicon[0]locally positioned at 1.5 in y using theguisprites[6]sprite (Beetle's gui icon) with a scale of (0.8, 0.8, 0.8)
- 0: A new sprite object childed to this GameObject locally positioned at 0.5 in y using the