RuralPowerCompetition_yizhe.../RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/MicroSystem/PhysicButton.cs

18 lines
598 B
C#

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<PhysicButtonContent>();return physicButtonContent; } }
public PhysicButtonType buttonType;
private void OnMouseDown()
{
if (EventUtilities.IsOverUI) return;
PhysicButtonContent.OnPhysicButtonDown(buttonType);
}
}