36 lines
860 B
C#
36 lines
860 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace RimWorldAnimationStudio
|
|
{
|
|
public class Tag : MonoBehaviour
|
|
{
|
|
public string tagName = "New Tag";
|
|
public Text tagText;
|
|
public GameObject tagPrefab;
|
|
|
|
public void Initialize(string tagName)
|
|
{
|
|
this.tagName = tagName;
|
|
tagText.text = tagName;
|
|
}
|
|
|
|
public void AddTag()
|
|
{
|
|
GameObject newTag = Instantiate(tagPrefab, transform.parent);
|
|
newTag.GetComponent<Tag>().Initialize(tagText.text);
|
|
|
|
tagText.text = tagName;
|
|
transform.SetAsLastSibling();
|
|
}
|
|
|
|
public void DeleteTag()
|
|
{
|
|
//SendMessageUpwards("DeleteTag", this);
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|