1
This commit is contained in:
@@ -4,11 +4,13 @@ using UnityEngine;
|
||||
|
||||
public class ColliderPlay : MonoBehaviour
|
||||
{
|
||||
|
||||
public bool isRepeat = true;
|
||||
bool isCanPlay = true;
|
||||
AudioSource source;
|
||||
|
||||
public Animator animator;
|
||||
//public Animator animator2;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -22,11 +24,25 @@ public class ColliderPlay : MonoBehaviour
|
||||
{
|
||||
if (!isCanPlay) return;
|
||||
if (source != null)
|
||||
source.Play();
|
||||
if (!isRepeat)
|
||||
{
|
||||
isCanPlay = false;
|
||||
if(animator != null)
|
||||
{
|
||||
source.Play();
|
||||
animator.Play("zr_2_shiyi");
|
||||
}
|
||||
else
|
||||
{
|
||||
source.Play();
|
||||
if (!isRepeat)
|
||||
{
|
||||
isCanPlay = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user