SkillScriptManager.cs 2.2 KB

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