how to get the mouse event in unity 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);
}
}