BGWindowPane.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using UnityEngine;
  2. namespace COM3D2.MeidoPhotoStudio.Plugin
  3. {
  4. public class BGWindowPane : BaseMainWindowPane
  5. {
  6. private readonly BackgroundSelectorPane backgroundSelectorPane;
  7. private readonly CameraPane cameraPane;
  8. private readonly LightsPane lightsPane;
  9. private readonly EffectsPane effectsPane;
  10. private readonly DragPointPane dragPointPane;
  11. private readonly OtherEffectsPane otherEffectsPane;
  12. private readonly Button sceneManagerButton;
  13. public BGWindowPane(
  14. EnvironmentManager environmentManager, LightManager lightManager, EffectManager effectManager,
  15. SceneWindow sceneWindow, CameraManager cameraManager
  16. )
  17. {
  18. sceneManagerButton = new Button(Translation.Get("backgroundWindow", "manageScenesButton"));
  19. sceneManagerButton.ControlEvent += (s, a) => sceneWindow.Visible = !sceneWindow.Visible;
  20. backgroundSelectorPane = AddPane(new BackgroundSelectorPane(environmentManager));
  21. cameraPane = AddPane(new CameraPane(cameraManager));
  22. dragPointPane = AddPane(new DragPointPane());
  23. lightsPane = AddPane(new LightsPane(lightManager));
  24. effectsPane = AddPane(new EffectsPane()
  25. {
  26. ["bloom"] = new BloomPane(effectManager),
  27. ["dof"] = new DepthOfFieldPane(effectManager),
  28. ["vignette"] = new VignettePane(effectManager),
  29. ["fog"] = new FogPane(effectManager)
  30. });
  31. otherEffectsPane = AddPane(new OtherEffectsPane(effectManager));
  32. }
  33. protected override void ReloadTranslation()
  34. {
  35. sceneManagerButton.Label = Translation.Get("backgroundWindow", "manageScenesButton");
  36. }
  37. public override void Draw()
  38. {
  39. tabsPane.Draw();
  40. sceneManagerButton.Draw();
  41. backgroundSelectorPane.Draw();
  42. dragPointPane.Draw();
  43. scrollPos = GUILayout.BeginScrollView(scrollPos);
  44. cameraPane.Draw();
  45. lightsPane.Draw();
  46. effectsPane.Draw();
  47. otherEffectsPane.Draw();
  48. GUILayout.EndScrollView();
  49. }
  50. public override void UpdatePanes()
  51. {
  52. if (ActiveWindow) base.UpdatePanes();
  53. }
  54. }
  55. }