public GameObject CastSkill(GameObject go, int skillId, int skillType, int stamp, string folderName, string prefabName, string target_id, Vector3 targetPos, bool needneedFeedback, string[] targetIds, bool isAct) { SceneEntity component = go.GetComponent <SceneEntity>(); if (component != null) { component.castSkill = go.transform.GetOrAddComponent <CastSkill>(); return(component.castSkill.StartSkill(skillId, skillType, stamp, folderName, prefabName, target_id, targetPos, needneedFeedback, targetIds, isAct)); } CastSkill orAddComponent = go.transform.GetOrAddComponent <CastSkill>(); return(orAddComponent.StartSkill(skillId, skillType, stamp, folderName, prefabName, target_id, targetPos, needneedFeedback, targetIds, isAct)); }
public static void Execute(ReturnUseSkillUserCmd_S cmd) { CastSkill cast = null; switch (cmd.owner.entrytype) { case Cmd.SceneEntryType.SceneEntryType_Npc: { var owner = Npc.All[cmd.owner.entryid]; if (owner != null) { cast = owner.CastSkill; } } break; case Cmd.SceneEntryType.SceneEntryType_Player: { var owner = Role.All[cmd.owner.entryid]; if (owner != null) { cast = owner.CastSkill; } } break; default: break; } var skill = table.TableSkill.Where(cmd.skillid, cmd.skilllevel); if (cast == null || skill == null) { return; } cast.StartSkill(skill, cmd.hurts); }