Example #1
0
    private void OnMouseUp()
    {
        // Check for current player that is claiming ownership of this space
        owner = tileManager.CurrentPlayer;

        // Set the sprite color to represent the owner (Sword = Blue, Shield = Red)
        if (owner == TileManager.Owner.Sword)
        {
            this.GetComponent <SpriteRenderer>().sprite = Sprite_Sword;
        }
        else if (owner == TileManager.Owner.Shield)
        {
            this.GetComponent <SpriteRenderer>().sprite = Shield_Sprite;
        }
        // Update to the next player in rotation
        tileManager.ChangePlayer();
    }
    private void OnMouseUp()
    {
        owner = tileManager.CurrentPlayer;

        if (owner == TileManager.Owner.Sword)
        {
            this.GetComponent <SpriteRenderer>().sprite = sprites[1];
            AudioSource.PlayClipAtPoint(swordUnsheath, transform.position);
        }
        else if (owner == TileManager.Owner.Shield)
        {
            this.GetComponent <SpriteRenderer>().sprite = sprites[2];
            AudioSource.PlayClipAtPoint(shieldHit, transform.position);
        }

        tileManager.ChangePlayer();
    }