Esempio n. 1
0
 public void Dehighlight()
 {
     if (!isSelected)
     {
         HighlightTilemap.SetTile(LocalPlace, null);
     }
 }
Esempio n. 2
0
 public void Highlight(Tile hightlightTile)
 {
     if (!isSelected)
     {
         HighlightTilemap.SetTile(LocalPlace, hightlightTile);
     }
 }
Esempio n. 3
0
    // Awake is called when the script is loaded, before Start. We initialize the piece here.
    public void Awake()
    {
        // Initialize all local object references.
        shadow             = transform.GetChild(0).gameObject;
        glow               = transform.GetChild(1).gameObject;
        glowSpriteRenderer = glow.GetComponent <SpriteRenderer>();
        body               = transform.GetChild(2).gameObject;
        audioSource        = transform.GetChild(3).GetComponent <AudioSource>();

        // Initialize all world object references.
        gameController   = GameObject.Find("/GameController").GetComponent <GameController>();
        highlightTilemap = GameObject.Find("/Grid/Highlight Tilemap").GetComponent <HighlightTilemap>();

        // Not glowing initially
        glow.SetActive(false);
    }
Esempio n. 4
0
 public void Select(Tile selectedTile)
 {
     isSelected = true;
     HighlightTilemap.SetTile(LocalPlace, selectedTile);
 }
Esempio n. 5
0
 public void Deselect()
 {
     isSelected = false;
     HighlightTilemap.SetTile(LocalPlace, null);
 }
Esempio n. 6
0
 private void Awake()
 {
     audioSource      = GetComponent <AudioSource>();
     highlightTilemap = GameObject.Find("/Grid/Highlight Tilemap").GetComponent <HighlightTilemap>();
 }