void ShowSkill_Anim(Skill_Anim _Anim) { AnimationClip animClip = EditorGUILayout.ObjectField(_Anim.animClip, typeof(AnimationClip), false) as AnimationClip; if (_Anim.animClip != animClip) { _Anim.SetAnimClip(animClip); } }
public void SetData(string skillName) { List <SkillXml> skillList = GameData.Instance.GetSkillsByRoleName("Teddy"); //Debug.Log(skillList[0]); foreach (var item in skillList) { if (item.name == skillName) { foreach (var ite in item.skills) { foreach (var it in ite.Value) { if (ite.Key.Equals("动画")) { AnimationClip clip = AssetDatabase.LoadAssetAtPath <AnimationClip>("Assets/GameDate/Anim/" + it + ".anim"); if (_Anim == null) { _Anim = new Skill_Anim(this); } _Anim.SetAnimClip(clip); //skillsList[item.name].Add(_Anim); } else if (ite.Key.Equals("音效")) { AudioClip clip = AssetDatabase.LoadAssetAtPath <AudioClip>("Assets/GameDate/Audio/" + it + ".mp3"); if (_Aduio == null) { _Aduio = new Skill_Audio(this); } _Aduio.SetAnimClip(clip); //skillsList[item.name].Add(_Anim); } else if (ite.Key.Equals("特效")) { GameObject clip = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/GameDate/Effect/Skill/" + it + ".prefab"); if (_Effect == null) { _Effect = new Skill_Effects(this); } _Effect.SetGameClip(clip); //skillsList[item.name].Add(_Anim); } } } } } }
void LoadAllSkill() { if (File.Exists("Assets/" + gameObject.name + ".txt")) { string str = File.ReadAllText("Assets/" + gameObject.name + ".txt"); List <SkillXml> skills = JsonConvert.DeserializeObject <List <SkillXml> >(str); foreach (var item in skills) { skillsList.Add(item.name, new List <SkillBase>()); foreach (var ite in item.skills) { foreach (var it in ite.Value) { if (ite.Key.Equals("动画")) { AnimationClip clip = AssetDatabase.LoadAssetAtPath <AnimationClip>("Assets/GameDate/Anim/" + it + ".anim"); Skill_Anim _Anim = new Skill_Anim(this); _Anim.SetAnimClip(clip); skillsList[item.name].Add(_Anim); } else if (ite.Key.Equals("音效")) { AudioClip clip = AssetDatabase.LoadAssetAtPath <AudioClip>("Assets/GameDate/Audio/" + it + ".mp3"); Skill_Audio _Anim = new Skill_Audio(this); _Anim.SetAnimClip(clip); skillsList[item.name].Add(_Anim); } else if (ite.Key.Equals("特效")) { GameObject clip = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/GameDate/Effect/Skill/" + it + ".prefab"); Skill_Effects _Anim = new Skill_Effects(this); _Anim.SetGameClip(clip); skillsList[item.name].Add(_Anim); } } } } } }
public void Copy(Skill_Anim data) { base.Copy(data); data.Anim = this.Anim; data.AnimSpeed = this.AnimSpeed; }