Code refactor

This commit is contained in:
AbstractConcept 2022-10-27 00:56:04 -05:00
parent cd4711a8e5
commit 757badf4f6
517 changed files with 2534 additions and 2221 deletions

View file

@ -1,35 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
namespace RimWorldAnimationStudio
{
public class RequiresAnimationDef : MonoBehaviour
{
private Button button;
private List<Text> buttonText;
private List<Color> buttonTextColor = new List<Color>();
public void Start()
{
button = GetComponent<Button>();
buttonText = GetComponentsInChildren<Text>()?.ToList();
if (buttonText != null)
{
for (int i = 0; i < buttonText.Count; i++)
{ buttonTextColor.Add(buttonText[i].color); }
}
}
public void Update()
{
button.interactable = Workspace.animationDef != null;
for (int i = 0; i < buttonText.Count; i++)
{ buttonText[i].color = button.interactable ? buttonTextColor[i] : Constants.ColorMidGrey; }
}
}
}