@@ -14,13 +14,13 @@ public enum PopupViewType
1414 AuthenticationView ,
1515 }
1616
17- [ SerializeField ] private bool shouldCloseOnFinish ;
17+ [ NonSerialized ] private IApiClient client ;
18+
1819 [ SerializeField ] private PopupViewType activeViewType ;
1920 [ SerializeField ] private AuthenticationView authenticationView ;
20- [ SerializeField ] private PublishView publishView ;
2121 [ SerializeField ] private LoadingView loadingView ;
22-
23- [ NonSerialized ] private IApiClient client ;
22+ [ SerializeField ] private PublishView publishView ;
23+ [ SerializeField ] private bool shouldCloseOnFinish ;
2424
2525 public event Action < bool > OnClose ;
2626
@@ -39,6 +39,79 @@ public static PopupWindow OpenWindow(PopupViewType popupViewType, Action<bool> o
3939 return popupWindow ;
4040 }
4141
42+ public override void Initialize ( IApplicationManager applicationManager )
43+ {
44+ base . Initialize ( applicationManager ) ;
45+
46+ publishView = publishView ?? new PublishView ( ) ;
47+ authenticationView = authenticationView ?? new AuthenticationView ( ) ;
48+ loadingView = loadingView ?? new LoadingView ( ) ;
49+
50+ publishView . InitializeView ( this ) ;
51+ authenticationView . InitializeView ( this ) ;
52+ loadingView . InitializeView ( this ) ;
53+
54+ titleContent = new GUIContent ( ActiveView . Title , Styles . SmallLogo ) ;
55+ }
56+
57+ public override void OnEnable ( )
58+ {
59+ base . OnEnable ( ) ;
60+ minSize = maxSize = ActiveView . Size ;
61+ ActiveView . OnEnable ( ) ;
62+ }
63+
64+ public override void OnDisable ( )
65+ {
66+ base . OnDisable ( ) ;
67+ ActiveView . OnDisable ( ) ;
68+ }
69+
70+ public override void OnDataUpdate ( )
71+ {
72+ base . OnDataUpdate ( ) ;
73+ ActiveView . OnDataUpdate ( ) ;
74+ }
75+
76+ public override void OnUI ( )
77+ {
78+ base . OnUI ( ) ;
79+ ActiveView . OnGUI ( ) ;
80+ }
81+
82+ public override void Refresh ( )
83+ {
84+ base . Refresh ( ) ;
85+ ActiveView . Refresh ( ) ;
86+ }
87+
88+ public override void OnSelectionChange ( )
89+ {
90+ base . OnSelectionChange ( ) ;
91+ ActiveView . OnSelectionChange ( ) ;
92+ }
93+
94+ public override void Finish ( bool result )
95+ {
96+ OnClose . SafeInvoke ( result ) ;
97+ OnClose = null ;
98+
99+ if ( shouldCloseOnFinish )
100+ {
101+ shouldCloseOnFinish = false ;
102+ Close ( ) ;
103+ }
104+
105+ base . Finish ( result ) ;
106+ }
107+
108+ public override void OnDestroy ( )
109+ {
110+ base . OnDestroy ( ) ;
111+ OnClose . SafeInvoke ( false ) ;
112+ OnClose = null ;
113+ }
114+
42115 private void Open ( PopupViewType popupViewType , Action < bool > onClose )
43116 {
44117 OnClose . SafeInvoke ( false ) ;
@@ -130,79 +203,6 @@ public IApiClient Client
130203 }
131204 }
132205
133- public override void Initialize ( IApplicationManager applicationManager )
134- {
135- base . Initialize ( applicationManager ) ;
136-
137- publishView = publishView ?? new PublishView ( ) ;
138- authenticationView = authenticationView ?? new AuthenticationView ( ) ;
139- loadingView = loadingView ?? new LoadingView ( ) ;
140-
141- publishView . InitializeView ( this ) ;
142- authenticationView . InitializeView ( this ) ;
143- loadingView . InitializeView ( this ) ;
144-
145- titleContent = new GUIContent ( ActiveView . Title , Styles . SmallLogo ) ;
146- }
147-
148- public override void OnEnable ( )
149- {
150- base . OnEnable ( ) ;
151- minSize = maxSize = ActiveView . Size ;
152- ActiveView . OnEnable ( ) ;
153- }
154-
155- public override void OnDisable ( )
156- {
157- base . OnDisable ( ) ;
158- ActiveView . OnDisable ( ) ;
159- }
160-
161- public override void OnDataUpdate ( )
162- {
163- base . OnDataUpdate ( ) ;
164- ActiveView . OnDataUpdate ( ) ;
165- }
166-
167- public override void OnUI ( )
168- {
169- base . OnUI ( ) ;
170- ActiveView . OnGUI ( ) ;
171- }
172-
173- public override void Refresh ( )
174- {
175- base . Refresh ( ) ;
176- ActiveView . Refresh ( ) ;
177- }
178-
179- public override void OnSelectionChange ( )
180- {
181- base . OnSelectionChange ( ) ;
182- ActiveView . OnSelectionChange ( ) ;
183- }
184-
185- public override void Finish ( bool result )
186- {
187- OnClose . SafeInvoke ( result ) ;
188- OnClose = null ;
189-
190- if ( shouldCloseOnFinish )
191- {
192- shouldCloseOnFinish = false ;
193- Close ( ) ;
194- }
195-
196- base . Finish ( result ) ;
197- }
198-
199- public override void OnDestroy ( )
200- {
201- base . OnDestroy ( ) ;
202- OnClose . SafeInvoke ( false ) ;
203- OnClose = null ;
204- }
205-
206206 private Subview ActiveView
207207 {
208208 get
0 commit comments