Unity技能编辑器小进阶优化

对昨天的技能编辑器进行了简单的优化,加上了攻击等特效,实现粒子特效等,加载在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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值