Exemplo n.º 1
0
 void Awake()
 {
     thisPosition.x = transform.position.x;
     thisPosition.y = transform.position.y;
     build          = FindObjectOfType <BuildSettings>();
     gc             = FindObjectOfType <GlobalController>();
     col            = GetComponent <BoxCollider2D>();
     sprite         = GetComponent <SpriteRenderer>();
     build.SetPlayerSpawn(thisPosition);
 }
Exemplo n.º 2
0
 void Update()
 {
     thisPosition.x = transform.position.x;
     thisPosition.y = transform.position.y;
     if (thisPosition != build.GetPlayerSpawn())
     {
         build.SetPlayerSpawn(thisPosition);
     }
     //hide any collisions/graphics
     if (!gc.GetIsBuilding())
     {
         sprite.enabled = false;
         col.enabled    = false;
     }
     else if (gc.GetIsBuilding())
     {
         sprite.enabled = true;
         col.enabled    = true;
     }
 }