您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
22 行
475 B
22 行
475 B
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
|
|
[RequireComponent(typeof(PlayableDirector))]
|
|
public class GameplayTrigger : MonoBehaviour
|
|
{
|
|
public bool repeatable = false;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
public void OnTriggerEnter2D(Collider2D collision)
|
|
{
|
|
if (enabled && collision.CompareTag("Player"))
|
|
{
|
|
GetComponent<PlayableDirector>().Play();
|
|
if (!repeatable)
|
|
enabled = false;
|
|
}
|
|
}
|
|
}
|