34 lines
1006 B
C#
34 lines
1006 B
C#
using UnityEngine;
|
|
using Octopus.Simulator;
|
|
using UnityEngine.UI;
|
|
|
|
public class TransformToolbarScript : MonoBehaviour
|
|
{
|
|
Button Button_Hand;
|
|
Button Button_Move;
|
|
Button Button_Rotate;
|
|
Button Button_Scale;
|
|
|
|
private void Awake()
|
|
{
|
|
Button_Hand = transform.Find(nameof(Button_Hand)).GetComponent<Button>();
|
|
Button_Move = transform.Find(nameof(Button_Move)).GetComponent<Button>();
|
|
Button_Rotate = transform.Find(nameof(Button_Rotate)).GetComponent<Button>();
|
|
Button_Scale = transform.Find(nameof(Button_Scale)).GetComponent<Button>();
|
|
|
|
}
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
FindAnyObjectByType<Panel_SimulationUI>().onPlaying += OnPlay;
|
|
}
|
|
|
|
void OnPlay(bool flag)
|
|
{
|
|
Button_Hand.interactable = !flag;
|
|
Button_Move.interactable = !flag;
|
|
Button_Rotate.interactable = !flag;
|
|
Button_Scale.interactable = !flag;
|
|
}
|
|
}
|