unity function after mouse click code example
Example: onmouseclick unity
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;public class ExampleClass : MonoBehaviour
{
void OnMouseDown()
{
// Destroy the gameObject after clicking on it
Destroy(gameObject);
}
}