123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class AquariumManage : MonoBehaviour
- {
-
- public SCButton moguyuButton, jiaohuButton, bigshellsButton;
-
- public Animator mgy;
- public GameObject moguyuTeXiao;
- public AudioSource kunAudio;
-
- private bool isPlay;
- public bool IsPlay
- {
- get => isPlay;
- set
- {
- isPlay = value;
-
- }
- }
- void Start()
- {
-
- StartCoroutine(PlaykunAudio());
- moguyuButton.onClick.AddListener(() =>
- {
- moguyuButton.gameObject.GetComponent<Animator>().SetBool("Open", true);
- mgy.SetBool("Open", true);
- moguyuTeXiao.gameObject.SetActive(true);
- });
- jiaohuButton.onClick.AddListener(() =>
- {
- JiaohuManage();
- });
- bigshellsButton.onClick.AddListener(() =>
- {
- BigshellManage();
- });
- }
-
-
-
-
- IEnumerator PlaykunAudio()
- {
- while (true)
- {
- yield return new WaitForSeconds(8f);
- kunAudio.Play();
- }
- }
- public void JiaohuManage()
- {
- jiaohuButton.gameObject.GetComponent<Animator>().Play("jiaohu");
- }
- public void BigshellManage()
- {
- bigshellsButton.gameObject.GetComponent<Animator>().Play("Take 001 0");
- }
-
-
-
-
-
-
- }
|