60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SingleTouchPlayAnimator : MonoBehaviour
|
|
{
|
|
//public GameObject animatorDaoJiu;
|
|
public GameObject animatorDaoJiuzhu;
|
|
Animator animator;
|
|
Animator animatorpig;
|
|
//¼ÆÊ±Ïà¹Ø
|
|
//bool isRun = false;
|
|
//float waitTime = 5f;
|
|
//float runTime = 0;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
animatorpig= animatorDaoJiuzhu.GetComponent<Animator>();
|
|
//if (animatorDaoJiu != null)
|
|
//{
|
|
// animatorDaoJiu.SetActive(false);
|
|
//}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
//if (isRun)
|
|
//{
|
|
// runTime += Time.deltaTime;
|
|
// if (runTime > waitTime)
|
|
// {
|
|
// isRun = false;
|
|
// runTime = 0;
|
|
//if (animatorDaoJiu != null)
|
|
//{
|
|
// animatorDaoJiu.SetActive(false);
|
|
//}
|
|
// }
|
|
//}
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.gameObject.name == "PalmBox_L" || other.gameObject.name == "PalmBox_R")
|
|
{
|
|
animator.Play("Touch");
|
|
animatorpig.Play("Touch");
|
|
}
|
|
|
|
//if (animatorDaoJiu != null)
|
|
//{
|
|
// animatorDaoJiu.SetActive(true);
|
|
// animatorDaoJiu.GetComponent<Animator>().Play("Touch");
|
|
// isRun = true;
|
|
//}
|
|
}
|
|
}
|