SkillScriptManager.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using Excel2Json;
  2. using Fort23.Core;
  3. using Fort23.UTool;
  4. using GameLogic.Combat.Skill;
  5. using Utility;
  6. namespace GameLogic.Combat.CombatTool
  7. {
  8. public class SkillScriptManager : Singleton<SkillScriptManager>
  9. {
  10. public static object ActivatorLoock = "lock";
  11. public SkillBasic CreateSkillBasic(SkillConfig skillConfig)
  12. {
  13. try
  14. {
  15. string typeName = "GameLogic.Combat.Skill." + skillConfig.scriptName;
  16. // lock (ActivatorLoock)
  17. {
  18. System.Type type = System.Type.GetType(typeName);
  19. if (type == null)
  20. {
  21. typeName = "GameLogic.Combat.Skill.MagicSkill." + skillConfig.scriptName;
  22. type = System.Type.GetType(typeName);
  23. if (type == null)
  24. {
  25. if (skillConfig.SkillType != 5 && skillConfig.SkillType != 6)
  26. {
  27. LogTool.Error("没有技能脚本" + typeName);
  28. }
  29. return null;
  30. }
  31. }
  32. // SkillBasic
  33. SkillBasic sb = (SkillBasic)CObjectPool.Instance.Fetch(type);
  34. return sb;
  35. }
  36. }
  37. catch (System.Exception e)
  38. {
  39. LogTool.Log(e + "错误技能" + skillConfig.scriptName);
  40. }
  41. return null;
  42. }
  43. // public SuitBasic CreateSkillBasic(RelicSuitConfig relicSuitConfig)
  44. // {
  45. // try
  46. // {
  47. // string typeName = "Common.Combat.Suit." + relicSuitConfig.ScriptName;
  48. // // lock (ActivatorLoock)
  49. // {
  50. // System.Type type = System.Type.GetType(typeName);
  51. // if (type == null)
  52. // {
  53. // return null;
  54. // }
  55. //
  56. // SuitBasic suitBasic = (SuitBasic)System.Activator.CreateInstance(type);
  57. // suitBasic.Init(relicSuitConfig);
  58. // return suitBasic;
  59. // }
  60. // }
  61. // catch (System.Exception e)
  62. // {
  63. // LogTool.Log("错误套装" + relicSuitConfig.ScriptName);
  64. // }
  65. //
  66. // return null;
  67. // }
  68. }
  69. }