1
This commit is contained in:
@@ -4,41 +4,41 @@ using UnityEngine;
|
||||
|
||||
public class SingleTouchPlayAnimator : MonoBehaviour
|
||||
{
|
||||
public GameObject animatorDaoJiu;
|
||||
//public GameObject animatorDaoJiu;
|
||||
public GameObject animatorDaoJiuzhu;
|
||||
Animator animator;
|
||||
Animator animatorpig;
|
||||
//<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
||||
bool isRun = false;
|
||||
float waitTime = 5f;
|
||||
float runTime = 0;
|
||||
//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);
|
||||
}
|
||||
//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);
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (isRun)
|
||||
//{
|
||||
// runTime += Time.deltaTime;
|
||||
// if (runTime > waitTime)
|
||||
// {
|
||||
// isRun = false;
|
||||
// runTime = 0;
|
||||
//if (animatorDaoJiu != null)
|
||||
//{
|
||||
// animatorDaoJiu.SetActive(false);
|
||||
//}
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
@@ -49,11 +49,11 @@ public class SingleTouchPlayAnimator : MonoBehaviour
|
||||
animatorpig.Play("Touch");
|
||||
}
|
||||
|
||||
if (animatorDaoJiu != null)
|
||||
{
|
||||
animatorDaoJiu.SetActive(true);
|
||||
animatorDaoJiu.GetComponent<Animator>().Play("Touch");
|
||||
isRun = true;
|
||||
}
|
||||
//if (animatorDaoJiu != null)
|
||||
//{
|
||||
// animatorDaoJiu.SetActive(true);
|
||||
// animatorDaoJiu.GetComponent<Animator>().Play("Touch");
|
||||
// isRun = true;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user