void OnTriggerEnter(Collider other) { if (cutscene == null) { Debug.LogError("Cutscene is not provided", gameObject); return; } if (checkSpecificTagOnly && !string.IsNullOrEmpty(tagName)) { if (other.gameObject.tag != tagName) { return; } } enabled = false; cutscene.Play(() => { onFinish.Invoke(); if (once) { Destroy(this.gameObject); } else { enabled = true; } }); }
void OnMouseDown() { if (cutscene == null) { Debug.LogError("Cutscene is not provided", gameObject); return; } cutscene.Play(() => { onFinish.Invoke(); }); }
void Start() { if (cutscene == null) { Debug.LogError("Cutscene is not provided", gameObject); return; } cutscene.Play(startTime, () => { onFinish.Invoke(); }); }
IEnumerator Start() { yield return(null); if (cutscene == null) { Debug.LogError("Cutscene is not provided", gameObject); yield break; } cutscene.Play(() => { onFinish.Invoke(); }); }