mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
35 lines
860 B
C#
35 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);
|
|
}
|
|
}
|
|
}
|