【Unity】技能编辑器编写分享

1,在Editor下创建技能编辑窗口 保存技能数据 在Json中
2,运行游戏 加载技能Json文件保存在Mgr中
3,点击发消息 AnimMgr EffectMgr接受消息 改变动画 生成技能


Editor下技能编辑

image.png



AnimMgr

image.png


EffectMgr

image.png


人物放技能的轨道

image.png


技能延迟协程工具

image.png

    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]);
    }

猜你喜欢

转载自blog.csdn.net/m0_74022070/article/details/131722223