对昨天的技能编辑器进行了简单的优化,加上了攻击等特效,实现粒子特效等,加载在json表中
写入携程,可以让他继承单例
using System;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
namespace Editor
{
public class ScheduleOnce:Singleton<ScheduleOnce>
{
int id = 0;
Dictionary<int, Coroutine> dic = new Dictionary<int, Coroutine>();
public void AddSchedule(MonoBehaviour self, float time, Action<object> action,params object[] arr)
{
int name = id++;
Coroutine coroutine = self.StartCoroutine(DelayFun(self, name, time, action,arr));
dic.Add(name,coroutine);
}
//携程函数
IEnumerator DelayFun(MonoBehaviour self, int name, float time, Action<object> action,params object[] arr)
{
yield return new WaitForSeconds(time);
action(arr);
self.StopCoroutine(dic[name]);
}
public void AddSchedule(MonoBehaviour self