Ejemplo n.º 1
0
 public void Dehighlight()
 {
     if (!isSelected)
     {
         HighlightTilemap.SetTile(LocalPlace, null);
     }
 }
Ejemplo n.º 2
0
 public void Highlight(Tile hightlightTile)
 {
     if (!isSelected)
     {
         HighlightTilemap.SetTile(LocalPlace, hightlightTile);
     }
 }
Ejemplo 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);
    }
Ejemplo n.º 4
0
 public void Select(Tile selectedTile)
 {
     isSelected = true;
     HighlightTilemap.SetTile(LocalPlace, selectedTile);
 }
Ejemplo n.º 5
0
 public void Deselect()
 {
     isSelected = false;
     HighlightTilemap.SetTile(LocalPlace, null);
 }
Ejemplo n.º 6
0
 private void Awake()
 {
     audioSource      = GetComponent <AudioSource>();
     highlightTilemap = GameObject.Find("/Grid/Highlight Tilemap").GetComponent <HighlightTilemap>();
 }