| | 1 | | using DCL; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEngine; |
| | 4 | | using UnityEngine.UI; |
| | 5 | |
|
| | 6 | | public class TaskbarHUDView : MonoBehaviour |
| | 7 | | { |
| | 8 | | const string VIEW_PATH = "Taskbar"; |
| | 9 | | const string PORTABLE_EXPERIENCE_ITEMS_POOL = "PortableExperienceItems"; |
| | 10 | |
|
| | 11 | | [Header("Taskbar Animation")] |
| | 12 | | [SerializeField] internal ShowHideAnimator taskbarAnimator; |
| | 13 | |
|
| | 14 | | [Header("Left Side Config")] |
| | 15 | | [SerializeField] internal RectTransform leftWindowContainer; |
| | 16 | |
|
| | 17 | | [SerializeField] internal ShowHideAnimator leftWindowContainerAnimator; |
| | 18 | | [SerializeField] internal LayoutGroup leftWindowContainerLayout; |
| | 19 | | [SerializeField] internal GameObject voiceChatButtonPlaceholder; |
| | 20 | | [SerializeField] internal VoiceChatButton voiceChatButton; |
| | 21 | | [SerializeField] internal TaskbarButton chatButton; |
| | 22 | | [SerializeField] internal TaskbarButton friendsButton; |
| | 23 | | [SerializeField] internal ChatHeadGroupView chatHeadsGroup; |
| | 24 | |
|
| | 25 | | [Header("Right Side Config")] |
| | 26 | | [SerializeField] internal HorizontalLayoutGroup rightButtonsHorizontalLayout; |
| | 27 | |
|
| | 28 | | [SerializeField] internal TaskbarButton settingsButton; |
| | 29 | | [SerializeField] internal TaskbarButton exploreButton; |
| | 30 | | [SerializeField] internal TaskbarButton builderInWorldButton; |
| | 31 | | [SerializeField] internal GameObject portableExperiencesDiv; |
| | 32 | | [SerializeField] internal PortableExperienceTaskbarItem portableExperienceItem; |
| | 33 | | [SerializeField] internal TaskbarButton questPanelButton; |
| | 34 | |
|
| | 35 | | [Header("More Button Config")] |
| | 36 | | [SerializeField] internal TaskbarButton moreButton; |
| | 37 | |
|
| | 38 | | [SerializeField] internal TaskbarMoreMenu moreMenu; |
| | 39 | |
|
| | 40 | | [Header("Tutorial Config")] |
| | 41 | | [SerializeField] internal RectTransform exploreTooltipReference; |
| | 42 | |
|
| | 43 | | [SerializeField] internal RectTransform moreTooltipReference; |
| | 44 | | [SerializeField] internal RectTransform socialTooltipReference; |
| | 45 | |
|
| | 46 | | [Header("Old TaskbarCompatibility (temporal)")] |
| | 47 | | [SerializeField] internal RectTransform taskbarPanelTransf; |
| | 48 | |
|
| | 49 | | [SerializeField] internal Image taskbarPanelImage; |
| | 50 | | [SerializeField] internal GameObject rightButtonsContainer; |
| | 51 | |
|
| | 52 | | internal TaskbarHUDController controller; |
| 22 | 53 | | internal bool isBarVisible = true; |
| 22 | 54 | | internal Dictionary<string, PortableExperienceTaskbarItem> activePortableExperienceItems = new Dictionary<string, Po |
| 22 | 55 | | internal Dictionary<string, PoolableObject> activePortableExperiencesPoolables = new Dictionary<string, PoolableObje |
| | 56 | | internal Pool portableExperiencesPool = null; |
| | 57 | |
|
| | 58 | | public event System.Action OnChatToggleOn; |
| | 59 | | public event System.Action OnChatToggleOff; |
| | 60 | | public event System.Action OnFriendsToggleOn; |
| | 61 | | public event System.Action OnFriendsToggleOff; |
| | 62 | | public event System.Action OnSettingsToggleOn; |
| | 63 | | public event System.Action OnSettingsToggleOff; |
| | 64 | | public event System.Action OnBuilderInWorldToggleOn; |
| | 65 | | public event System.Action OnBuilderInWorldToggleOff; |
| | 66 | | public event System.Action OnExploreToggleOn; |
| | 67 | | public event System.Action OnExploreToggleOff; |
| | 68 | | public event System.Action OnMoreToggleOn; |
| | 69 | | public event System.Action OnMoreToggleOff; |
| | 70 | | public event System.Action<bool> OnQuestPanelToggled; |
| | 71 | |
|
| | 72 | | internal List<TaskbarButton> GetButtonList() |
| | 73 | | { |
| 16 | 74 | | var taskbarButtonList = new List<TaskbarButton>(); |
| 16 | 75 | | taskbarButtonList.Add(chatButton); |
| 16 | 76 | | taskbarButtonList.Add(friendsButton); |
| 16 | 77 | | taskbarButtonList.AddRange(chatHeadsGroup.chatHeads); |
| 16 | 78 | | taskbarButtonList.Add(builderInWorldButton); |
| 16 | 79 | | taskbarButtonList.Add(settingsButton); |
| 16 | 80 | | taskbarButtonList.Add(exploreButton); |
| 16 | 81 | | taskbarButtonList.Add(moreButton); |
| 16 | 82 | | taskbarButtonList.Add(questPanelButton); |
| | 83 | |
|
| 16 | 84 | | using (var iterator = activePortableExperienceItems.GetEnumerator()) |
| | 85 | | { |
| 16 | 86 | | while (iterator.MoveNext()) |
| | 87 | | { |
| 0 | 88 | | taskbarButtonList.Add(iterator.Current.Value.mainButton); |
| | 89 | | } |
| 16 | 90 | | } |
| | 91 | |
|
| 16 | 92 | | return taskbarButtonList; |
| | 93 | | } |
| | 94 | |
|
| | 95 | | internal static TaskbarHUDView Create(TaskbarHUDController controller, IChatController chatController, |
| | 96 | | IFriendsController friendsController) |
| | 97 | | { |
| 11 | 98 | | var view = Instantiate(Resources.Load<GameObject>(VIEW_PATH)).GetComponent<TaskbarHUDView>(); |
| 11 | 99 | | view.Initialize(controller, chatController, friendsController); |
| 11 | 100 | | return view; |
| | 101 | | } |
| | 102 | |
|
| | 103 | | public void Initialize(TaskbarHUDController controller, IChatController chatController, |
| | 104 | | IFriendsController friendsController) |
| | 105 | | { |
| 11 | 106 | | this.controller = controller; |
| | 107 | |
|
| 11 | 108 | | ShowBar(true, true); |
| 11 | 109 | | chatButton.transform.parent.gameObject.SetActive(false); |
| 11 | 110 | | friendsButton.transform.parent.gameObject.SetActive(false); |
| 11 | 111 | | builderInWorldButton.transform.parent.gameObject.SetActive(false); |
| 11 | 112 | | settingsButton.transform.parent.gameObject.SetActive(false); |
| 11 | 113 | | exploreButton.transform.parent.gameObject.SetActive(false); |
| 11 | 114 | | voiceChatButtonPlaceholder.SetActive(false); |
| 11 | 115 | | voiceChatButton.gameObject.SetActive(false); |
| | 116 | |
|
| 11 | 117 | | moreButton.gameObject.SetActive(true); |
| 11 | 118 | | moreMenu.Initialize(this); |
| 11 | 119 | | moreMenu.ShowMoreMenu(false, true); |
| | 120 | |
|
| 11 | 121 | | chatHeadsGroup.Initialize(chatController, friendsController); |
| 11 | 122 | | chatButton.Initialize(); |
| 11 | 123 | | friendsButton.Initialize(); |
| 11 | 124 | | builderInWorldButton.Initialize(); |
| 11 | 125 | | settingsButton.Initialize(); |
| 11 | 126 | | exploreButton.Initialize(); |
| 11 | 127 | | moreButton.Initialize(); |
| 11 | 128 | | questPanelButton.Initialize(); |
| | 129 | |
|
| 11 | 130 | | chatHeadsGroup.OnHeadToggleOn += OnWindowToggleOn; |
| 11 | 131 | | chatHeadsGroup.OnHeadToggleOff += OnWindowToggleOff; |
| | 132 | |
|
| 11 | 133 | | chatButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 134 | | chatButton.OnToggleOff += OnWindowToggleOff; |
| | 135 | |
|
| 11 | 136 | | friendsButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 137 | | friendsButton.OnToggleOff += OnWindowToggleOff; |
| | 138 | |
|
| 11 | 139 | | builderInWorldButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 140 | | builderInWorldButton.OnToggleOff += OnWindowToggleOff; |
| | 141 | |
|
| 11 | 142 | | settingsButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 143 | | settingsButton.OnToggleOff += OnWindowToggleOff; |
| | 144 | |
|
| 11 | 145 | | exploreButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 146 | | exploreButton.OnToggleOff += OnWindowToggleOff; |
| | 147 | |
|
| 11 | 148 | | moreButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 149 | | moreButton.OnToggleOff += OnWindowToggleOff; |
| | 150 | |
|
| 11 | 151 | | questPanelButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 152 | | questPanelButton.OnToggleOff -= OnWindowToggleOff; |
| 11 | 153 | | questPanelButton.OnToggleOn += OnWindowToggleOn; |
| 11 | 154 | | questPanelButton.OnToggleOff += OnWindowToggleOff; |
| | 155 | |
|
| 11 | 156 | | portableExperiencesDiv.SetActive(false); |
| | 157 | |
|
| 11 | 158 | | portableExperiencesPool = PoolManager.i.AddPool( |
| | 159 | | PORTABLE_EXPERIENCE_ITEMS_POOL, |
| | 160 | | Instantiate(portableExperienceItem.gameObject), |
| | 161 | | maxPrewarmCount: 5, |
| | 162 | | isPersistent: true); |
| | 163 | |
|
| 11 | 164 | | portableExperiencesPool.ForcePrewarm(); |
| | 165 | |
|
| 11 | 166 | | AdjustRightButtonsLayoutWidth(); |
| 11 | 167 | | } |
| | 168 | |
|
| | 169 | | public void SetBuilderInWorldStatus(bool isActive) |
| | 170 | | { |
| 1 | 171 | | builderInWorldButton.transform.parent.gameObject.SetActive(isActive); |
| 1 | 172 | | AdjustRightButtonsLayoutWidth(); |
| 1 | 173 | | } |
| | 174 | |
|
| 0 | 175 | | public void SetQuestsPanelStatus(bool isActive) { questPanelButton.transform.parent.gameObject.SetActive(isActive); |
| | 176 | |
|
| | 177 | | private void OnWindowToggleOff(TaskbarButton obj) |
| | 178 | | { |
| 6 | 179 | | if (obj == friendsButton) |
| 2 | 180 | | OnFriendsToggleOff?.Invoke(); |
| 4 | 181 | | else if (obj == chatButton) |
| 2 | 182 | | OnChatToggleOff?.Invoke(); |
| 2 | 183 | | else if (obj == settingsButton) |
| 0 | 184 | | OnSettingsToggleOff?.Invoke(); |
| 2 | 185 | | else if (obj == builderInWorldButton) |
| 0 | 186 | | OnBuilderInWorldToggleOff?.Invoke(); |
| 2 | 187 | | else if (obj == exploreButton) |
| 1 | 188 | | OnExploreToggleOff?.Invoke(); |
| 1 | 189 | | else if (obj == moreButton) |
| 0 | 190 | | moreMenu.ShowMoreMenu(false); |
| 1 | 191 | | else if (obj == questPanelButton) |
| 0 | 192 | | OnQuestPanelToggled?.Invoke(false); |
| | 193 | | else |
| | 194 | | { |
| 1 | 195 | | using (var iterator = activePortableExperienceItems.GetEnumerator()) |
| | 196 | | { |
| 1 | 197 | | while (iterator.MoveNext()) |
| | 198 | | { |
| 0 | 199 | | if (iterator.Current.Value.mainButton == obj) |
| | 200 | | { |
| 0 | 201 | | iterator.Current.Value.ShowContextMenu(false); |
| 0 | 202 | | break; |
| | 203 | | } |
| | 204 | | } |
| 1 | 205 | | } |
| | 206 | | } |
| | 207 | |
|
| 6 | 208 | | if (AllButtonsToggledOff()) |
| | 209 | | { |
| 5 | 210 | | chatButton.SetToggleState(false, useCallback: false); |
| 5 | 211 | | controller.worldChatWindowHud.SetVisibility(true); |
| | 212 | | } |
| 6 | 213 | | } |
| | 214 | |
|
| | 215 | | public bool AllButtonsToggledOff() |
| | 216 | | { |
| 8 | 217 | | var btns = GetButtonList(); |
| | 218 | |
|
| 8 | 219 | | bool allToggledOff = true; |
| | 220 | |
|
| 134 | 221 | | foreach (var btn in btns) |
| | 222 | | { |
| 59 | 223 | | if (btn.toggledOn) |
| 1 | 224 | | allToggledOff = false; |
| | 225 | | } |
| | 226 | |
|
| 8 | 227 | | return allToggledOff; |
| | 228 | | } |
| | 229 | |
|
| | 230 | | private void OnWindowToggleOn(TaskbarButton obj) |
| | 231 | | { |
| 6 | 232 | | if (obj == friendsButton) |
| 2 | 233 | | OnFriendsToggleOn?.Invoke(); |
| 4 | 234 | | else if (obj == chatButton) |
| 3 | 235 | | OnChatToggleOn?.Invoke(); |
| 1 | 236 | | else if (obj == settingsButton) |
| 0 | 237 | | OnSettingsToggleOn?.Invoke(); |
| 1 | 238 | | else if (obj == builderInWorldButton) |
| 0 | 239 | | OnBuilderInWorldToggleOn?.Invoke(); |
| 1 | 240 | | else if (obj == exploreButton) |
| 0 | 241 | | OnExploreToggleOn?.Invoke(); |
| 1 | 242 | | else if (obj == moreButton) |
| 0 | 243 | | moreMenu.ShowMoreMenu(true); |
| 1 | 244 | | else if (obj == questPanelButton) |
| 0 | 245 | | OnQuestPanelToggled?.Invoke(true); |
| | 246 | | else |
| | 247 | | { |
| 1 | 248 | | using (var iterator = activePortableExperienceItems.GetEnumerator()) |
| | 249 | | { |
| 1 | 250 | | while (iterator.MoveNext()) |
| | 251 | | { |
| 0 | 252 | | if (iterator.Current.Value.mainButton == obj) |
| | 253 | | { |
| 0 | 254 | | iterator.Current.Value.ShowContextMenu(true); |
| 0 | 255 | | break; |
| | 256 | | } |
| | 257 | | } |
| 1 | 258 | | } |
| | 259 | | } |
| | 260 | |
|
| 6 | 261 | | SelectButton(obj); |
| 6 | 262 | | } |
| | 263 | |
|
| | 264 | | public void SelectButton(TaskbarButton obj) |
| | 265 | | { |
| 7 | 266 | | var taskbarButtonList = GetButtonList(); |
| | 267 | |
|
| 120 | 268 | | foreach (var btn in taskbarButtonList) |
| | 269 | | { |
| 53 | 270 | | if (btn != obj) |
| | 271 | | { |
| | 272 | | // We let the use of the chat and friends windows while we are using the explore at the same time |
| 46 | 273 | | if ((btn == exploreButton && (obj == chatButton || obj == friendsButton || obj is ChatHeadButton)) || |
| | 274 | | ((btn == chatButton || btn == friendsButton || btn is ChatHeadButton) && obj == exploreButton)) |
| | 275 | | continue; |
| | 276 | |
|
| 40 | 277 | | btn.SetToggleState(false, useCallback: true); |
| | 278 | | } |
| | 279 | | } |
| 7 | 280 | | } |
| | 281 | |
|
| 4 | 282 | | internal void OnAddChatWindow() { chatButton.transform.parent.gameObject.SetActive(true); } |
| | 283 | |
|
| 6 | 284 | | internal void OnAddFriendsWindow() { friendsButton.transform.parent.gameObject.SetActive(true); } |
| | 285 | |
|
| | 286 | | internal void OnAddSettingsWindow() |
| | 287 | | { |
| 2 | 288 | | settingsButton.transform.parent.gameObject.SetActive(true); |
| 2 | 289 | | AdjustRightButtonsLayoutWidth(); |
| 2 | 290 | | } |
| | 291 | |
|
| | 292 | | internal void OnAddExploreWindow() |
| | 293 | | { |
| 2 | 294 | | exploreButton.transform.parent.gameObject.SetActive(true); |
| 2 | 295 | | AdjustRightButtonsLayoutWidth(); |
| 2 | 296 | | } |
| | 297 | |
|
| 4 | 298 | | internal void OnAddHelpAndSupportWindow() { moreMenu.ActivateHelpAndSupportButton(); } |
| | 299 | |
|
| 4 | 300 | | internal void OnAddControlsMoreOption() { moreMenu.ActivateControlsButton(); } |
| | 301 | |
|
| | 302 | | internal void OnAddVoiceChat() |
| | 303 | | { |
| 0 | 304 | | voiceChatButtonPlaceholder.SetActive(true); |
| 0 | 305 | | voiceChatButton.gameObject.SetActive(true); |
| 0 | 306 | | } |
| | 307 | |
|
| | 308 | | internal void ShowBar(bool visible, bool instant = false) |
| | 309 | | { |
| 13 | 310 | | if (visible) |
| 12 | 311 | | taskbarAnimator.Show(instant); |
| | 312 | | else |
| 1 | 313 | | taskbarAnimator.Hide(instant); |
| | 314 | |
|
| 13 | 315 | | isBarVisible = visible; |
| 13 | 316 | | } |
| | 317 | |
|
| 2 | 318 | | public void SetVisibility(bool visible) { gameObject.SetActive(visible); } |
| | 319 | |
|
| | 320 | | private void OnDestroy() |
| | 321 | | { |
| 11 | 322 | | if (chatHeadsGroup != null) |
| | 323 | | { |
| 11 | 324 | | chatHeadsGroup.OnHeadToggleOn -= OnWindowToggleOn; |
| 11 | 325 | | chatHeadsGroup.OnHeadToggleOff -= OnWindowToggleOff; |
| | 326 | | } |
| | 327 | |
|
| 11 | 328 | | if (chatButton != null) |
| | 329 | | { |
| 11 | 330 | | chatButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 331 | | chatButton.OnToggleOff -= OnWindowToggleOff; |
| | 332 | | } |
| | 333 | |
|
| 11 | 334 | | if (friendsButton != null) |
| | 335 | | { |
| 11 | 336 | | friendsButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 337 | | friendsButton.OnToggleOff -= OnWindowToggleOff; |
| | 338 | | } |
| | 339 | |
|
| 11 | 340 | | if (settingsButton != null) |
| | 341 | | { |
| 11 | 342 | | settingsButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 343 | | settingsButton.OnToggleOff -= OnWindowToggleOff; |
| | 344 | | } |
| | 345 | |
|
| 11 | 346 | | if (builderInWorldButton != null) |
| | 347 | | { |
| 11 | 348 | | builderInWorldButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 349 | | builderInWorldButton.OnToggleOff -= OnWindowToggleOff; |
| | 350 | | } |
| | 351 | |
|
| 11 | 352 | | if (exploreButton != null) |
| | 353 | | { |
| 11 | 354 | | exploreButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 355 | | exploreButton.OnToggleOff -= OnWindowToggleOff; |
| | 356 | | } |
| | 357 | |
|
| 11 | 358 | | if (moreButton != null) |
| | 359 | | { |
| 11 | 360 | | moreButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 361 | | moreButton.OnToggleOff -= OnWindowToggleOff; |
| | 362 | | } |
| | 363 | |
|
| 11 | 364 | | if (questPanelButton != null) |
| | 365 | | { |
| 11 | 366 | | questPanelButton.OnToggleOn -= OnWindowToggleOn; |
| 11 | 367 | | questPanelButton.OnToggleOff -= OnWindowToggleOff; |
| | 368 | | } |
| 11 | 369 | | } |
| | 370 | |
|
| | 371 | | internal void AddPortableExperienceElement(string id, string name, string iconUrl) |
| | 372 | | { |
| 2 | 373 | | if (portableExperiencesPool == null) |
| 0 | 374 | | return; |
| | 375 | |
|
| 2 | 376 | | portableExperiencesDiv.SetActive(true); |
| | 377 | |
|
| 2 | 378 | | PoolableObject newPEPoolable = portableExperiencesPool.Get(); |
| 2 | 379 | | newPEPoolable.gameObject.name = $"PortableExperienceItem ({id})"; |
| 2 | 380 | | newPEPoolable.gameObject.transform.SetParent(rightButtonsContainer.transform); |
| 2 | 381 | | newPEPoolable.gameObject.transform.localScale = Vector3.one; |
| 2 | 382 | | newPEPoolable.gameObject.transform.SetAsFirstSibling(); |
| | 383 | |
|
| 2 | 384 | | PortableExperienceTaskbarItem newPEItem = newPEPoolable.gameObject.GetComponent<PortableExperienceTaskbarItem>() |
| 2 | 385 | | newPEItem.ConfigureItem(id, name, iconUrl, controller); |
| 2 | 386 | | newPEItem.mainButton.OnToggleOn += OnWindowToggleOn; |
| 2 | 387 | | newPEItem.mainButton.OnToggleOff += OnWindowToggleOff; |
| | 388 | |
|
| 2 | 389 | | activePortableExperienceItems.Add(id, newPEItem); |
| 2 | 390 | | activePortableExperiencesPoolables.Add(id, newPEPoolable); |
| | 391 | |
|
| 2 | 392 | | AdjustRightButtonsLayoutWidth(); |
| 2 | 393 | | } |
| | 394 | |
|
| | 395 | | internal void RemovePortableExperienceElement(string id) |
| | 396 | | { |
| 1 | 397 | | if (portableExperiencesPool == null) |
| 0 | 398 | | return; |
| | 399 | |
|
| 1 | 400 | | if (activePortableExperienceItems.ContainsKey(id)) |
| | 401 | | { |
| 1 | 402 | | PortableExperienceTaskbarItem peToRemove = activePortableExperienceItems[id]; |
| | 403 | |
|
| 1 | 404 | | peToRemove.mainButton.OnToggleOn -= OnWindowToggleOn; |
| 1 | 405 | | peToRemove.mainButton.OnToggleOff -= OnWindowToggleOff; |
| | 406 | |
|
| 1 | 407 | | activePortableExperienceItems.Remove(id); |
| 1 | 408 | | portableExperiencesPool.Release(activePortableExperiencesPoolables[id]); |
| 1 | 409 | | activePortableExperiencesPoolables.Remove(id); |
| | 410 | | } |
| | 411 | |
|
| 1 | 412 | | if (activePortableExperienceItems.Count == 0) |
| 1 | 413 | | portableExperiencesDiv.SetActive(false); |
| | 414 | |
|
| 1 | 415 | | AdjustRightButtonsLayoutWidth(); |
| 1 | 416 | | } |
| | 417 | |
|
| | 418 | | [ContextMenu("AdjustRightButtonsLayoutWidth")] |
| | 419 | | private void AdjustRightButtonsLayoutWidth() |
| | 420 | | { |
| 19 | 421 | | float totalWidth = 0f; |
| 19 | 422 | | int numActiveChild = 0; |
| 19 | 423 | | RectTransform rightButtonsContainerRT = (RectTransform)rightButtonsContainer.transform; |
| | 424 | |
|
| 270 | 425 | | for (int i = 0; i < rightButtonsContainerRT.childCount; i++) |
| | 426 | | { |
| 116 | 427 | | RectTransform child = (RectTransform)rightButtonsContainerRT.GetChild(i); |
| | 428 | |
|
| 116 | 429 | | if (!child.gameObject.activeSelf) |
| | 430 | | continue; |
| | 431 | |
|
| 50 | 432 | | totalWidth += child.sizeDelta.x; |
| 50 | 433 | | numActiveChild++; |
| | 434 | | } |
| | 435 | |
|
| 19 | 436 | | totalWidth += |
| | 437 | | ((numActiveChild - 1) * rightButtonsHorizontalLayout.spacing) + |
| | 438 | | rightButtonsHorizontalLayout.padding.left + |
| | 439 | | rightButtonsHorizontalLayout.padding.right; |
| | 440 | |
|
| 19 | 441 | | ((RectTransform)rightButtonsContainer.transform).sizeDelta = new Vector2(totalWidth, ((RectTransform)rightButton |
| 19 | 442 | | } |
| | 443 | | } |