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.

88 lines
2.3 KiB

2 years ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using DG.Tweening;
public class Canvas2 : MonoBehaviour
{
public AudioClip[] ac;
AudioSource audioSource;
public GameObject tip2;
public GameObject step2_1;
public GameObject step2_2;
public Animator animator;
public GameObject errorTip;
public GameObject step2_3;
private void Start()
{
audioSource = GetComponent<AudioSource>();
EventManager.Instance.register("NextAc", NextAc);
EventManager.Instance.register("ActionTwoEnd", ActionTwoEnd);
EventManager.Instance.register("guancha",Guancha);
tip2.SetActive(true);
Invoke("InitLevel2", 3);
}
void InitLevel2()
{
tip2.GetComponentInChildren<Tip>().str = "<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ȷ<EFBFBD>IJ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>ѯ<EFBFBD><D1AF>";
tip2.SetActive(false);
step2_1.SetActive(true);
tip2.SetActive(true);
}
void Guancha(params object[] data) {
audioSource.clip = ac[1];
audioSource.Play();
}
public void ActionOne(bool inspect) {
if (inspect)
{
step2_1.SetActive(false);
audioSource.clip = ac[0];
audioSource.Play();
animator.SetTrigger("Huhuan");
}
else {
errorTip.SetActive(true);
errorTip.GetComponentInChildren<ErrorTip>().InitThis("<22><>ǰ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
}
void NextAc(params object[] data) {
GameObject obj = Instantiate(Resources.Load<GameObject>("operate"), GameObject.FindWithTag("Grid").transform);
obj.GetComponent<Operate>().str = "1-<2D>жϱ<D0B6><CFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ";
tip2.GetComponentInChildren<Tip>().str = "<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ȷ<EFBFBD>IJ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD>й۲<D0B9>";
tip2.SetActive(false);
tip2.SetActive(true);
step2_2.SetActive(true);
}
void ActionTwoEnd(params object[] data) {
step2_3.SetActive(true);
}
public void ActionTwo(bool inspect)
{
if (inspect)
{
step2_2.SetActive(false);
animator.SetTrigger("Tuoyi");
}
else
{
errorTip.SetActive(true);
errorTip.GetComponentInChildren<ErrorTip>().InitThis("<22><>ǰ<EFBFBD>۲첿λ<ECB2BF><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
}
}