GQ_Communicate/GQ_URP/GQ/Assets/Scripts/WJ/RobotManager.cs

66 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class RobotManager : CabinetUIBase
{
public static RobotManager Instance { get; private set; }
public Animator animator;
public GameObject robot_object;
public Button close_button;
public GameObject video_canvas;
private void Awake()
{
Instance = this;
}
private void Start()
{
close_button.onClick.AddListener(() =>
{
HideVideo();
});
}
public void ShowRobot()
{
robot_object.SetActive(true);
}
public void HideRobot()
{
robot_object.SetActive(false);
}
public void DoAnimation()
{
animator.SetBool("move", true);
}
public void ShowVideo()
{
video_canvas.SetActive(true);
}
public void HideVideo()
{
video_canvas.SetActive(false);
}
public override void OnMenuChanged(Menu menu)
{
base.OnMenuChanged(menu);
if (menu == Menu.M_Êý×Ö»ú·¿_ÖÇÄÜѲ¼ì)
{
ShowRobot();
}
else
{
HideRobot();
}
}
}