Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/OnClickCallMethod.cs
2026-02-21 16:45:37 +08:00

23 lines
454 B
C#

using Photon;
using UnityEngine;
[RequireComponent(typeof(Collider))]
public class OnClickCallMethod : Photon.MonoBehaviour
{
public GameObject TargetGameObject;
public string TargetMethod;
public void OnClick()
{
if (TargetGameObject == null || string.IsNullOrEmpty(TargetMethod))
{
Debug.LogWarning(string.Concat(this, " can't call, cause GO or Method are empty."));
}
else
{
TargetGameObject.SendMessage(TargetMethod);
}
}
}