45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class WorkorderComponent : MonoBehaviour
|
|
{
|
|
static public WorkorderComponent instance;
|
|
[HideInInspector]
|
|
public bool filledOrder = false;
|
|
public Transform weighRoot;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
for (int i = 0; i < weighRoot.childCount; i++)
|
|
{
|
|
if (weighRoot.gameObject.name.Contains("Toggle"))
|
|
{
|
|
weighRoot.GetComponent<Toggle>().onValueChanged.AddListener(OrderChanged);
|
|
}
|
|
else if (weighRoot.gameObject.name.Contains("InputField"))
|
|
{
|
|
weighRoot.GetComponent<InputField>().onValueChanged.AddListener(OrderChanged);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void OrderChanged(bool b)
|
|
{
|
|
filledOrder = true;
|
|
}
|
|
|
|
public void OrderChanged(string s)
|
|
{
|
|
filledOrder = true;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|