Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
87 lines
1.9 KiB
C#
87 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cute;
|
|
using UnityEngine;
|
|
|
|
public class ConventionListUI : UIBase
|
|
{
|
|
private const int SCROLL_CONVENTION_COUNT = 3;
|
|
|
|
[SerializeField]
|
|
private ConventionListPlate _conventionItemOriginal;
|
|
|
|
[SerializeField]
|
|
private UIScrollView _scrollView;
|
|
|
|
[SerializeField]
|
|
private UIGrid _grid;
|
|
|
|
[SerializeField]
|
|
private GameObject _conventionListPlateRoot;
|
|
|
|
[SerializeField]
|
|
private GameObject _backGround;
|
|
|
|
[SerializeField]
|
|
private GameObject _layout1;
|
|
|
|
[SerializeField]
|
|
private GameObject[] _layout2;
|
|
|
|
[SerializeField]
|
|
private GameObject _scrollBar;
|
|
|
|
private List<ConventionListPlate> _plateList = new List<ConventionListPlate>();
|
|
|
|
public Action<ConventionInfo> OnSelect { get; set; }
|
|
|
|
private void Awake()
|
|
{
|
|
_conventionItemOriginal.gameObject.SetActive(value: false);
|
|
}
|
|
|
|
public void Show(ConventionList conventionList)
|
|
{
|
|
List<ConventionInfo> list = conventionList.List;
|
|
int num = 0;
|
|
foreach (ConventionInfo item in list)
|
|
{
|
|
GameObject parent = _conventionListPlateRoot;
|
|
switch (list.Count)
|
|
{
|
|
case 1:
|
|
parent = _layout1;
|
|
break;
|
|
case 2:
|
|
parent = _layout2[num];
|
|
break;
|
|
}
|
|
num++;
|
|
GameObject obj = NGUITools.AddChild(parent, _conventionItemOriginal.gameObject);
|
|
obj.SetActive(value: true);
|
|
ConventionListPlate component = obj.GetComponent<ConventionListPlate>();
|
|
component.Initialize(item);
|
|
component.OnSelect = OnSelectConvention;
|
|
_plateList.Add(component);
|
|
}
|
|
_backGround.SetActive(list.Count > 3);
|
|
_grid.Reposition();
|
|
_scrollView.ResetPosition();
|
|
}
|
|
|
|
private void OnSelectConvention(ConventionInfo convention)
|
|
{
|
|
OnSelect.Call(convention);
|
|
foreach (ConventionListPlate plate in _plateList)
|
|
{
|
|
plate.FadeOutHide();
|
|
}
|
|
}
|
|
|
|
public void Hide()
|
|
{
|
|
_backGround.SetActive(value: false);
|
|
_scrollBar.SetActive(value: false);
|
|
}
|
|
}
|