1234567891011121314151617181920212223242526 |
- using System;
- using UnityEngine;
- namespace I2.Loc
- {
- [Serializable]
- public class EventCallback
- {
- public void Execute(UnityEngine.Object Sender = null)
- {
- if (this.HasCallback() && Application.isPlaying)
- {
- this.Target.gameObject.SendMessage(this.MethodName, Sender, SendMessageOptions.DontRequireReceiver);
- }
- }
- public bool HasCallback()
- {
- return this.Target != null && !string.IsNullOrEmpty(this.MethodName);
- }
- public MonoBehaviour Target;
- public string MethodName = string.Empty;
- }
- }
|