static public SkillUnit.SkillArt CloneSkillArt(SkillUnit.SkillArt a) { SkillUnit.SkillArt b = new SkillUnit.SkillArt(); b.beginCameraAction = a.beginCameraAction; List <SkillUnit.SkillArtEffect> bl = b.beginEffect; for (int i = 0; i < a.beginEffect.Count; i++) { SkillUnit.SkillArtEffect se = a.beginEffect[i]; bl.Add(se); } b.endAction = a.endAction; b.endEffect = a.endEffect; b.guideAction = a.guideAction; b.guideFadeTime = a.guideFadeTime; b.guidingAction = a.guidingAction; b.hitCameraAction = a.hitCameraAction; b.id = a.id; b.tipReferPoint = a.tipReferPoint; b.moveCameraAction = a.moveCameraAction; b.tipEffect = a.tipEffect; b.unitEffect = a.unitEffect; return(b); }
public static void ConvertSkillArt(SkillUnit.SkillArt oUnit, SkillArt unit) { oUnit.id = unit.id; oUnit.guideAction = unit.guideAction; oUnit.guideFadeTime = unit.guideFadeTime; oUnit.guidingAction = unit.guidingAction; oUnit.endAction = unit.endAction; oUnit.unitEffect = ConvertSkillArtEffect(unit.unitEffect[0].artEffect); oUnit.tipEffect = ConvertSkillArtEffect(unit.tipEffect[0].artEffect); oUnit.hitEffect = ConvertSkillArtEffect(unit.hitEffect[0].artEffect); oUnit.beginCameraAction = ConvertCameraAction(unit.beginCameraAction[0]); oUnit.moveCameraAction = ConvertCameraAction(unit.moveCameraAction[0]); oUnit.hitCameraAction = ConvertCameraAction(unit.hitCameraAction[0]); List <SkillUnit.SkillArtEffect> beginlist = oUnit.beginEffect; for (int i = 0; i < unit.beginEffect.Count; i++) { SkillUnit.SkillArtEffect Effect = new SkillUnit.SkillArtEffect(); Effect = ConvertSkillArtEffect(unit.beginEffect[i].artEffect); oUnit.beginEffect.Add(Effect); } }
static public SkillUnit.SkillArt GetSkillArtById(int artid) { for (int i = 0; i < allSkillUnits.arts.Count; i++) { SkillUnit.SkillArt art = allSkillUnits.arts[i]; Debug.Log("art id " + art.id + " " + art.guideAction); if (art.id == artid) { return(art); } } return(null); }
public static void UseSkillArt(SkillUnit.SkillArt oart) { SkillArt art = EditorDataContainer.currentskillAssetData.skillArt; DataConvert.ConvertSkillArt(art, oart); string effectName = EditorDataContainer.GetStringById(oart.unitEffect.effect); if (art.unitEffect == null) { art.unitEffect = new List <SkillEffectUnit>(); } if (art.unitEffect.Count == 0) { art.unitEffect.Add(new SkillEffectUnit()); } art.unitEffect[0].artEffect.effectObj = AssetUtility.GetSkillEffect(art.modelType, art.modelName, effectName); string hitEffectName = EditorDataContainer.GetStringById(oart.hitEffect.effect); if (art.hitEffect == null) { art.hitEffect = new List <SkillEffectUnit>(); } if (art.hitEffect.Count == 0) { art.hitEffect.Add(new SkillEffectUnit()); } art.hitEffect[0].artEffect.effectObj = AssetUtility.GetSkillEffect(art.modelType, art.modelName, hitEffectName); if (art.tipEffect == null) { art.tipEffect = new List <SkillEffectUnit>(); } if (art.tipEffect.Count == 0) { art.tipEffect.Add(new SkillEffectUnit()); } art.tipEffect[0].artEffect.effectObj = AssetUtility.GetSkillEffect(art.modelType, art.modelName, hitEffectName); for (int i = 0; i < oart.beginEffect.Count; i++) { string beginEffectName = EditorDataContainer.GetStringById(oart.beginEffect[i].effect); art.beginEffect[i].artEffect.effectObj = AssetUtility.GetSkillEffect(art.modelType, art.modelName, beginEffectName); } }
public static void ConvertSkillArt(SkillArt oUnit, SkillUnit.SkillArt unit) { oUnit.id = unit.id; oUnit.guideAction = unit.guideAction; oUnit.guideFadeTime = unit.guideFadeTime; oUnit.guidingAction = unit.guidingAction; oUnit.endAction = unit.endAction; if (oUnit.unitEffect == null) { oUnit.unitEffect = new List <SkillEffectUnit>(); } if (oUnit.tipEffect == null) { oUnit.tipEffect = new List <SkillEffectUnit>(); } if (oUnit.hitEffect == null) { oUnit.hitEffect = new List <SkillEffectUnit>(); } if (oUnit.unitEffect.Count == 0) { oUnit.unitEffect.Add(new SkillEffectUnit()); } if (oUnit.tipEffect.Count == 0) { oUnit.tipEffect.Add(new SkillEffectUnit()); } if (oUnit.hitEffect.Count == 0) { oUnit.hitEffect.Add(new SkillEffectUnit()); } ConvertSkillArtEffect(oUnit.unitEffect[0].artEffect, unit.unitEffect); ConvertSkillArtEffect(oUnit.tipEffect[0].artEffect, unit.tipEffect); ConvertSkillArtEffect(oUnit.hitEffect[0].artEffect, unit.hitEffect); if (oUnit.beginEffect == null) { oUnit.beginEffect = new List <SkillEffectUnit>(); } oUnit.beginEffect.Clear(); for (int i = 0; i < unit.beginEffect.Count; i++) { SkillEffectUnit Effect = new SkillEffectUnit(); ConvertSkillArtEffect(Effect.artEffect, unit.beginEffect[i]); oUnit.beginEffect.Add(Effect); } }
public static SkillArt ConvertSkillArt(SkillUnit.SkillArt unit) { SkillArt oUnit = new SkillArt(); oUnit.id = unit.id; oUnit.guideAction = unit.guideAction; oUnit.guideFadeTime = unit.guideFadeTime; oUnit.guidingAction = unit.guidingAction; oUnit.endAction = unit.endAction; oUnit.unitEffect = new List <SkillEffectUnit>(); oUnit.unitEffect.Add(new SkillEffectUnit()); oUnit.unitEffect[0].artEffect = ConvertSkillArtEffect(unit.unitEffect); oUnit.tipEffect = new List <SkillEffectUnit>(); oUnit.tipEffect.Add(new SkillEffectUnit()); oUnit.tipEffect[0].artEffect = ConvertSkillArtEffect(unit.tipEffect); oUnit.hitEffect = new List <SkillEffectUnit>(); oUnit.hitEffect.Add(new SkillEffectUnit()); oUnit.hitEffect[0].artEffect = ConvertSkillArtEffect(unit.hitEffect); oUnit.beginCameraAction = new List <SkillCameraAction>(); oUnit.beginCameraAction.Add(new SkillCameraAction()); oUnit.beginCameraAction[0] = ConvertCameraAction(unit.beginCameraAction); oUnit.moveCameraAction = new List <SkillCameraAction>(); oUnit.moveCameraAction.Add(new SkillCameraAction()); oUnit.moveCameraAction[0] = ConvertCameraAction(unit.moveCameraAction); oUnit.hitCameraAction = new List <SkillCameraAction>(); oUnit.hitCameraAction.Add(new SkillCameraAction()); oUnit.hitCameraAction[0] = ConvertCameraAction(unit.hitCameraAction); oUnit.beginEffect = new List <SkillEffectUnit>(); for (int i = 0; i < unit.beginEffect.Count; i++) { SkillEffectUnit Effect = new SkillEffectUnit(); Effect.artEffect = ConvertSkillArtEffect(unit.beginEffect[i]); oUnit.beginEffect.Add(Effect); } return(oUnit); }
private void OnGUI() { EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField("输入技能id数字或id名称搜索"); id = EditorGUILayout.IntField("id数字:", id); idName = EditorGUILayout.TextField("id名称:", idName); if (GUILayout.Button("id数字搜索并应用", GUILayout.Height(40))) { if (id > 0 && EditorDataContainer.allSkillUnits.units.Count > id) { idName = EditorDataContainer.GetSkillStringById(id); DataConvert.ConvertSkillUnit(EditorDataContainer.currentskillAssetData.skillUnit, EditorDataContainer.allSkillUnits.units[id]); int curart = EditorDataContainer.currentskillAssetData.skillUnit.artId; SkillUnit.SkillArt oart = EditorDataContainer.allSkillUnits.arts[curart]; DataConvert.ConvertSkillArt(EditorDataContainer.currentskillAssetData.skillArt, oart); EditorDataContainer.UseSkillArt(oart); } } if (GUILayout.Button("id名字搜索并应用", GUILayout.Height(40))) { id = EditorDataContainer.GetSkillIdByString(idName); if (id > 0 && EditorDataContainer.allSkillUnits.units.Count > id) { DataConvert.ConvertSkillUnit(EditorDataContainer.currentskillAssetData.skillUnit, EditorDataContainer.allSkillUnits.units[id]); int curart = EditorDataContainer.currentskillAssetData.skillUnit.artId; SkillUnit.SkillArt oart = EditorDataContainer.allSkillUnits.arts[curart]; DataConvert.ConvertSkillArt(EditorDataContainer.currentskillAssetData.skillArt, oart); EditorDataContainer.UseSkillArt(oart); } } if (GUILayout.Button("Close", GUILayout.Height(40))) { Close(); } EditorGUILayout.EndVertical(); }
private void DrawButtons() { //使用选择的技能参数 if (GUILayout.Button(new GUIContent("Use Choose Unit\n加载选择的技能数据", "使用选择的技能Unit"), GUILayout.Height(40))) { DataConvert.ConvertSkillUnit(EditorDataContainer.currentskillAssetData.skillUnit, EditorDataContainer.allSkillUnits.units[SelectSkillUnit]); int curart = EditorDataContainer.currentskillAssetData.skillUnit.artId; SkillUnit.SkillArt oart = EditorDataContainer.allSkillUnits.arts[curart]; DataConvert.ConvertSkillArt(EditorDataContainer.currentskillAssetData.skillArt, oart); EditorDataContainer.UseSkillArt(oart); } //使用选择的技能参数 if (GUILayout.Button(new GUIContent("Use Choose Skill Art\n加载选择的特效数据", "使用选择的技能数据填充当前技能数据"), GUILayout.Height(40))) { SkillUnit.SkillArt oart = EditorDataContainer.allSkillUnits.arts[SelectSkillArt]; EditorDataContainer.UseSkillArt(oart); } if (GUILayout.Button(new GUIContent("Generate Sequence\n生成序列", "生成序列"), GUILayout.Height(40))) { EditorDataContainer.GenerateSequence(EditorDataContainer.currentskillAssetData); Close(); } if (GUILayout.Button(new GUIContent("Generate SkillData\n生成技能数据", "由当前序列生成技能数据对象"), GUILayout.Height(40))) { if (CurrentSequence != null) { EditorDataContainer.currentskillAssetData = EditorDataContainer.MakeSkillAssetData(CurrentSequence); Debug.Log(EditorDataContainer.currentskillAssetData.skillArt.beginEffect.Count); Reset(); } } if (GUILayout.Button("Search\n搜索技能", GUILayout.Height(40))) { var window = GetWindow <SearchWindow>(); window.Show(); } if (GUILayout.Button("Save Asset\n保存技能为Asset", GUILayout.Height(40))) { EditorDataContainer.SaveSkillAssetData(); } if (GUILayout.Button("Load Asset\n加载Asset技能文件", GUILayout.Height(40))) { EditorDataContainer.LoadSkillAssetData(); Reset(); Repaint(); } if (GUILayout.Button("Save SystemTables\n保存技能到系统表", GUILayout.Height(40))) { EditorDataContainer.SaveSystemTables(); EditorDataContainer.LoadSystemTables(); Reset(); Repaint(); } if (GUILayout.Button(showUnitList ? "HideSkillUnitList\n隐藏系统技能表" : "ShowSkillUnitList\n显示系统技能表", GUILayout.Height(40))) { showUnitList = !showUnitList; } if (GUILayout.Button(showArtList ? "HideSkillArtList\n隐藏系统特效表" : "ShowSkillArtList\n显示系统特效表", GUILayout.Height(40))) { showArtList = !showArtList; } if (GUILayout.Button("Close\n关闭窗口", GUILayout.Height(40))) { Close(); } }
private void DrawSkillArtList(float width) { GUILayout.BeginVertical("Box"); EditorGUILayout.LabelField("SkillArtEffect List"); LoadFbx(); LoadEffect(); // 设置保存文件名字 List <SkillUnit.SkillArt> skillart = EditorDataContainer.allSkillUnits.arts; artScrollPos = EditorGUILayout.BeginScrollView(artScrollPos); //列表 if (artList == null) { // 加入数据数组 artList = new ReorderableList(skillart, typeof(SkillUnit.SkillArt), false, false, true, true); } // 绘制Item显示列表 artList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { SkillUnit.SkillArt element = skillart[index]; Rect drawRect = new Rect(rect.x, rect.y + 20, width - 30, 1200); GUILayout.BeginArea(drawRect); EditorGUILayout.TextField("Id:" + element.id, EditorDataContainer.GetSkillStringById(element.id)); EditorGUILayout.FloatField("guideFadeTime:", element.guideFadeTime); EditorGUILayout.TextField("guideAction:", element.guideAction); EditorGUILayout.TextField("guidingAction:", element.guidingAction); EditorGUILayout.TextField("endAction:", element.endAction); for (int i = 0; i < element.beginEffect.Count; i++) { if (element.beginEffect[i] != null) { EditorGUILayout.LabelField("beginEffect:" + i); EditorDrawUtility.DrawSkillArtEffect(DataConvert.ConvertSkillArtEffect(element.beginEffect[i]), null, null); } } if (element.unitEffect != null) { EditorGUILayout.LabelField("unitEffect:"); EditorDrawUtility.DrawSkillArtEffect(DataConvert.ConvertSkillArtEffect(element.unitEffect), null, null); } if (element.tipEffect != null) { EditorGUILayout.LabelField("tipEffect:"); EditorDrawUtility.DrawSkillArtEffect(DataConvert.ConvertSkillArtEffect(element.tipEffect), null, null); } if (element.hitEffect != null) { EditorGUILayout.LabelField("hitEffect:"); EditorDrawUtility.DrawSkillArtEffect(DataConvert.ConvertSkillArtEffect(element.hitEffect), null, null); } if (element.beginCameraAction != null) { EditorGUILayout.LabelField("beginCameraAction:"); EditorDrawUtility.DrawCameraAction(DataConvert.ConvertCameraAction(element.beginCameraAction)); } if (element.moveCameraAction != null) { EditorGUILayout.LabelField("moveCameraAction:"); EditorDrawUtility.DrawCameraAction(DataConvert.ConvertCameraAction(element.moveCameraAction)); } if (element.hitCameraAction != null) { EditorGUILayout.LabelField("hitCameraAction:"); EditorDrawUtility.DrawCameraAction(DataConvert.ConvertCameraAction(element.hitCameraAction)); } GUILayout.EndArea(); EditorGUILayout.Separator(); artList.elementHeight = 1200;// 190 + element.beginEffect.Count * 80; }; // 绘制表头 artList.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "SkillArtList"); }; // 选择回调 artList.onSelectCallback = (ReorderableList l) => { SelectSkillArt = l.index; }; artList.DoLayoutList(); EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); }