Skip to content

Commit 9d3219a

Browse files
committed
Scripts Update 2
1 parent cea74fe commit 9d3219a

10 files changed

+1527
-0
lines changed

ActivateVFX.cs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class ActivateVFX : MonoBehaviour
6+
{
7+
8+
public GameObject vfx;
9+
// Start is called before the first frame update
10+
private void OnTriggerEnter(Collider other)
11+
{
12+
if(other.gameObject.CompareTag("Player"))
13+
{
14+
vfx.SetActive(true);
15+
}
16+
}
17+
18+
private void OnTriggerExit(Collider other)
19+
{
20+
if (other.gameObject.CompareTag("Player"))
21+
{
22+
StartCoroutine(VFXDisable());
23+
}
24+
}
25+
26+
IEnumerator VFXDisable()
27+
{
28+
yield return new WaitForSeconds(2f);
29+
vfx.SetActive(false);
30+
}
31+
}

0 commit comments

Comments
 (0)