【Unity】Skill editor writing and sharing

1. Create a skill editing window under the Editor and save the skill data in Json
2. Run the game to load the skill Json file and save it in Mgr
3. Click to send a message AnimMgr EffectMgr accept the message to change the animation generation skill


Skill editing under Editor

image.png



AnimMgr

image.png


EffectMgr

image.png


The track where the character puts his skills

image.png


Skill delayed coroutine tool

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

Guess you like

Origin blog.csdn.net/m0_74022070/article/details/131722223