using System; using System.Collections; using System.Collections.Generic; using System.Xml.Serialization; using UnityEngine; namespace eTaskHandleSystem { public interface ITaskState { /// <summary> /// 开始任务 /// </summary> void StartTask(); /// <summary> /// 取消任务 /// </summary> void CancelTask(); /// <summary> /// 完成任务 /// </summary> void CompletedTask(); } [Serializable] public class TaskModule: ITaskState { private string m_name; /// <summary> /// 任务名 /// </summary> public string Name => m_name; private int m_orderIndex; /// <summary> /// 任务排序 /// </summary> public int OrderIndex => m_orderIndex; #region 任务状态的回调集合 /// <summary> /// 任务完成情况 /// </summary> private bool m_isCompleted = false; /// <summary> /// 任务完成的回调 /// </summary> public Action OnCompletedCallback; /// <summary> /// 任务开始的回调 /// </summary> public Action OnStartCallback; /// <summary> /// 任务取消的回调 /// </summary> public Action OnCancelCallback; #endregion public void StartTask() { this.OnStartCallback?.Invoke(); } public void CancelTask() { this.OnCancelCallback?.Invoke(); } public void CompletedTask() { m_isCompleted = true; this.OnCompletedCallback?.Invoke(); } } }
标签:demo,void,系统,System,private,任务,using,public From: https://www.cnblogs.com/WantPeach/p/18414411