EditorPlugin.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Windows.Forms;
  5. using System.IO;
  6. using CommonAI.Zone.ZoneEditor;
  7. using GameEditorPlugin.Win32.Runtime;
  8. namespace CommonAIEditor
  9. {
  10. public interface IGameEditorPlugin
  11. {
  12. string Name { get; }
  13. /// <summary>
  14. /// 编辑器入口
  15. /// </summary>
  16. string DataRoot { get; set; }
  17. /// <summary>
  18. /// 游戏扩展DLL
  19. /// </summary>
  20. string PluginDLL { get; set; }
  21. /// <summary>
  22. /// 构造场景编辑器插件
  23. /// </summary>
  24. /// <param name="default_plugin"></param>
  25. /// <returns></returns>
  26. ISceneEditorPlugin CreateScenePlugin(IGameEditorPlugin default_plugin);
  27. /// <summary>
  28. /// 运行游戏测试
  29. /// </summary>
  30. /// <param name="default_plugin"></param>
  31. /// <param name="data_dir"></param>
  32. /// <param name="sceneID"></param>
  33. /// <param name="actorTemplateID"></param>
  34. void RunTest(IGameEditorPlugin default_plugin, string data_dir, int sceneID, int actorTemplateID);
  35. /// <summary>
  36. /// 运行资源查看功能
  37. /// </summary>
  38. /// <param name="default_plugin"></param>
  39. /// <param name="filepath"></param>
  40. void RunModelView(IGameEditorPlugin default_plugin, string[] filepath);
  41. /// <summary>
  42. /// 可接受的资源类型
  43. /// </summary>
  44. /// <param name="default_plugin"></param>
  45. /// <param name="filename"></param>
  46. /// <returns></returns>
  47. bool AcceptResource(IGameEditorPlugin default_plugin, string filename);
  48. /// <summary>
  49. /// 构造Win32测试工具
  50. /// </summary>
  51. /// <param name="default_plugin"></param>
  52. /// <param name="data_dir"></param>
  53. /// <param name="sceneID"></param>
  54. /// <param name="recorder"></param>
  55. /// <returns></returns>
  56. void RunLocalPlay(IGameEditorPlugin default_plugin, DirectoryInfo data_dir, int sceneID, bool recorder);
  57. /// <summary>
  58. /// 构造Win32测试工具
  59. /// </summary>
  60. /// <param name="default_plugin"></param>
  61. /// <param name="data_dir"></param>
  62. /// <param name="sceneID"></param>
  63. /// <returns></returns>
  64. void RunServerPlay(IGameEditorPlugin default_plugin, DirectoryInfo data_dir, int sceneID);
  65. }
  66. public delegate void PluginMessageHandler(object data);
  67. public delegate SceneObjectData CallAddSceneObject(Type type, Action<SceneObjectData> callback);
  68. public delegate SceneObjectData CallResetSceneObject(string name, Action<SceneObjectData> callback);
  69. public interface ISceneEditorPlugin
  70. {
  71. bool EnableRight { get; }
  72. Control AsControl();
  73. void SendMessage(object data);
  74. event PluginMessageHandler OnGetPluginMessage;
  75. event CallAddSceneObject CallAddObject;
  76. event CallResetSceneObject CallResetObject;
  77. }
  78. }