// Set the unity object tag public void ApplyTag(string tag) { textObj.tag = tag; background.tag = tag; if (border != null) { border.SetTag(tag); } }
// Function to alter the tag of the button (unity classification) public void ApplyTag(string tag) { button.tag = tag; background.tag = tag; border.SetTag(tag); }
// As above, but with // c: colour for the border public void AddBorder(Color c) { UnityEngine.Rect rect = background.GetComponent <RectTransform>().rect; border = new RectangleBorder(background.transform, c, new Vector2(rect.width / UIScaler.GetPixelsPerUnit(), rect.height / UIScaler.GetPixelsPerUnit())); border.SetTag(textObj.tag); }