using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhysicButton : MonoBehaviour { [SerializeField] private PhysicButtonContent physicButtonContent; public PhysicButtonContent PhysicButtonContent { get { if (physicButtonContent == null) physicButtonContent = transform.parent.GetComponentInChildren();return physicButtonContent; } } public PhysicButtonType buttonType; private void OnMouseDown() { if (EventUtilities.IsOverUI) return; PhysicButtonContent.OnPhysicButtonDown(buttonType); } }