mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Improved adding and removal of anim events
This commit is contained in:
parent
f0d46df3d6
commit
8523abf957
276 changed files with 1401 additions and 5422 deletions
36
Assets/Scripts/GUI/DialogBoxes/DialogBox.cs
Normal file
36
Assets/Scripts/GUI/DialogBoxes/DialogBox.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class DialogBox : MonoBehaviour
|
||||
{
|
||||
public List<GameObject> cloneObjects;
|
||||
|
||||
public void Pop()
|
||||
{
|
||||
gameObject.SetActive(gameObject.activeSelf == false);
|
||||
}
|
||||
|
||||
public void RemoveCloneObjectsFromParent(Transform parent)
|
||||
{
|
||||
for (int i = 0; i < parent.childCount; i++)
|
||||
{ Destroy(parent.transform.GetChild(i).gameObject); }
|
||||
}
|
||||
|
||||
public GameObject AddCloneObjectToParent(Transform parent, int i = 0)
|
||||
{
|
||||
GameObject cloneObject = null;
|
||||
|
||||
if (cloneObjects != null && cloneObjects.Count > i)
|
||||
{ cloneObject = Instantiate(cloneObjects[i], parent); }
|
||||
|
||||
return cloneObject;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue