1using System.Collections;
2using System.Collections.Generic;
5using NaughtyAttributes;
23 cg.blocksRaycasts = cg.alpha == 1f;
24 cg.interactable = cg.alpha == 1f;
29 cached.forceRender =
false;
34 if (sender.previewComponent)
45 foreach (var tcTag
in tc.tags)
53 Debug.Log(
"File is already global, hiding button!");
61 cached.forceRender =
false;
68 cg.blocksRaycasts = cg.alpha == 1f;
69 cg.interactable = cg.alpha == 1f;
73 private void CleanTagCloud()
75 for (
int i = 0; i <
tagCloud.transform.childCount - 2; i++)
77 Destroy(
tagCloud.transform.GetChild(i + 1).gameObject);
81 internal float GetTextWidth(Text t)
83 TextGenerator textGen =
new TextGenerator();
84 TextGenerationSettings generationSettings = t.GetGenerationSettings(t.rectTransform.rect.size);
85 float width = textGen.GetPreferredWidth(t.text, generationSettings);
90 internal void AddTag(
string tagName,
bool isNew =
false)
92 if (
string.IsNullOrEmpty(tagName) ||
string.IsNullOrWhiteSpace(tagName))
96 newTag.name = tagName;
97 var text = newTag.GetComponentInChildren<Text>();
99 var layoutElement = newTag.GetComponent<LayoutElement>();
100 layoutElement.preferredHeight = 30;
101 layoutElement.preferredWidth = GetTextWidth(text) + 10 + 25;
105 tc.
tags.Add(tagName);
115 tc.
tags.Remove(tagName);
GameObject makeGlobalButton
GameObject propertiesWindow
void RemoveTag(string tagName)
pb_PrefabBrowserItemButton preview