You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.8 KiB
74 lines
1.8 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class AllDoor : MonoBehaviour
|
|
{
|
|
public GameObject zf;
|
|
public GameObject ly;
|
|
public GameObject zfPage2;
|
|
public GameObject lyPage2;
|
|
public GameObject Door1;
|
|
public GameObject Door2;
|
|
public GameObject scheduled;
|
|
bool IsPlay = false;//是否正在播放音乐
|
|
//厕所自动门
|
|
public void openWCDoor() {
|
|
Door1.gameObject.GetComponent<Animator>().SetTrigger("openDoor");
|
|
}
|
|
|
|
public void closeWCDoor()
|
|
{
|
|
Door1.gameObject.GetComponent<Animator>().SetTrigger("closeDoor");
|
|
}
|
|
//卧室自动门
|
|
public void openWSDoor()
|
|
{
|
|
Door2.gameObject.GetComponent<Animator>().SetTrigger("openDoor");
|
|
}
|
|
|
|
public void closeWSDoor()
|
|
{
|
|
Door2.gameObject.GetComponent<Animator>().SetTrigger("closeDoor");
|
|
}
|
|
//音乐播放控制
|
|
public void swap() {
|
|
if (IsPlay)
|
|
{
|
|
IsPlay = false;
|
|
GetComponent<AudioSource>().Stop();
|
|
}
|
|
else
|
|
{
|
|
IsPlay = true;
|
|
print("播放音乐");
|
|
TaskCenter.GetInstance().FinishTask(6);
|
|
GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
|
|
//煮饭
|
|
public void ZF() {
|
|
zfPage2.SetActive(true);
|
|
}
|
|
|
|
public void LY()
|
|
{
|
|
lyPage2.SetActive(true);
|
|
//TaskCenter.GetInstance().FinishTask(5);
|
|
//scheduled.SetActive(true);
|
|
//scheduled.transform.GetChild(1).gameObject.SetActive(true);
|
|
//scheduled.transform.GetChild(2).gameObject.SetActive(true);
|
|
//Invoke("rs",60);
|
|
|
|
}
|
|
|
|
void rs() {
|
|
//ly.SetActive(true);
|
|
//scheduled.transform.GetChild(2).GetComponent<Text>().text="已完成";
|
|
}
|
|
|
|
|
|
}
|