Abdul Mukheem Shaik 1860fca79f Initial commit
2024-02-22 02:40:30 +01:00

20 lines
628 B
C#

using UnityEngine;
[RequireComponent(typeof(SphereCollider))]
public class SingularityCore : MonoBehaviour
{
//This script is responsible for what happens when the pullable objects reach the core
//by default, the game objects are simply turned off
//as this is much more performant than destroying the objects
void OnTriggerStay (Collider other) {
if(other.GetComponent<SingularityPullable>()){
other.gameObject.SetActive(false);
}
}
void Awake(){
if(GetComponent<SphereCollider>()){
GetComponent<SphereCollider>().isTrigger = true;
}
}
}