1234567891011121314151617181920212223242526272829303132333435 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class DeleteManager : MonoBehaviour
- {
- private GameObject gameObject;
-
- // Start is called before the first frame update
- void Start()
- {
- gameObject = null;
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- public void SetObjectToDelete(GameObject toDelete)
- {
- this.gameObject = toDelete;
- }
- public void DeleteGameObject()
- {
- if(gameObject != null)
- {
- Destroy(this.gameObject);
- }
- }
- }
|