Scene.cs 710 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace Base
  2. {
  3. public enum SceneType
  4. {
  5. Share,
  6. Game,
  7. Login,
  8. Lobby,
  9. Map,
  10. Launcher,
  11. Robot,
  12. BehaviorTreeScene,
  13. RobotClient,
  14. Realm,
  15. Gate,
  16. }
  17. [ObjectEvent]
  18. public class SceneEvent : ObjectEvent<Scene>, IAwake<SceneType, string>
  19. {
  20. public void Awake(SceneType sceneType, string name)
  21. {
  22. this.GetValue().Awake(sceneType, name);
  23. }
  24. }
  25. public sealed class Scene: Component
  26. {
  27. public SceneType SceneType { get; set; }
  28. public string Name { get; set; }
  29. public void Awake(SceneType sceneType, string name)
  30. {
  31. this.SceneType = sceneType;
  32. this.Name = name;
  33. }
  34. public override void Dispose()
  35. {
  36. if (this.Id == 0)
  37. {
  38. return;
  39. }
  40. base.Dispose();
  41. }
  42. }
  43. }