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.
157 lines
3.3 KiB
C#
157 lines
3.3 KiB
C#
using System.Collections;
|
|
using Cute;
|
|
using UnityEngine;
|
|
using Wizard;
|
|
|
|
public class MyPageCardPanel : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private UITexture _texture;
|
|
|
|
[SerializeField]
|
|
private string _filePath;
|
|
|
|
[SerializeField]
|
|
private UILabel _titleLabel;
|
|
|
|
[SerializeField]
|
|
private GameObject _effect;
|
|
|
|
[SerializeField]
|
|
private bool enableMaintenanceCheck;
|
|
|
|
[SerializeField]
|
|
protected NetworkDefine.MAINTENANCE_TYPE maintenanceType;
|
|
|
|
[SerializeField]
|
|
private NetworkDefine.MAINTENANCE_TYPE[] _maintenanceTypeList;
|
|
|
|
private CardPanelMaintenancePlate _maintenancePlate;
|
|
|
|
private Vector3? _savedPosition;
|
|
|
|
public UITexture Texture => _texture;
|
|
|
|
public string FilePath => _filePath;
|
|
|
|
protected UILabel TitleLabel => _titleLabel;
|
|
|
|
public int Index { get; set; }
|
|
|
|
public bool EffectActive
|
|
{
|
|
set
|
|
{
|
|
if (_effect != null)
|
|
{
|
|
_effect.SetActive(value);
|
|
}
|
|
}
|
|
}
|
|
|
|
public NetworkDefine.MAINTENANCE_TYPE MaintenanceType
|
|
{
|
|
get
|
|
{
|
|
return maintenanceType;
|
|
}
|
|
set
|
|
{
|
|
enableMaintenanceCheck = true;
|
|
maintenanceType = value;
|
|
}
|
|
}
|
|
|
|
public virtual string GetResourcePath(bool isfetch)
|
|
{
|
|
return Toolbox.ResourcesManager.GetAssetTypePath(FilePath, ResourcesManager.AssetLoadPathType.CardMenu, isfetch);
|
|
}
|
|
|
|
public void AttachCardPanelTexture()
|
|
{
|
|
Texture.mainTexture = Toolbox.ResourcesManager.LoadObject(GetResourcePath(isfetch: true)) as Texture;
|
|
}
|
|
|
|
public virtual void CheckMaintenanceType()
|
|
{
|
|
if (!enableMaintenanceCheck)
|
|
{
|
|
return;
|
|
}
|
|
bool flag = false;
|
|
if (Data.MaintenanceCodeList.Contains(maintenanceType))
|
|
{
|
|
flag = true;
|
|
}
|
|
if (_maintenanceTypeList != null && _maintenanceTypeList.Length != 0)
|
|
{
|
|
bool flag2 = true;
|
|
NetworkDefine.MAINTENANCE_TYPE[] maintenanceTypeList = _maintenanceTypeList;
|
|
foreach (NetworkDefine.MAINTENANCE_TYPE item in maintenanceTypeList)
|
|
{
|
|
if (!Data.MaintenanceCodeList.Contains(item))
|
|
{
|
|
flag2 = false;
|
|
break;
|
|
}
|
|
}
|
|
if (flag2)
|
|
{
|
|
flag = true;
|
|
}
|
|
}
|
|
if (flag)
|
|
{
|
|
ShowMaintenance();
|
|
}
|
|
else
|
|
{
|
|
HideMaintenance();
|
|
}
|
|
}
|
|
|
|
private void ShowMaintenance()
|
|
{
|
|
if (_maintenancePlate == null)
|
|
{
|
|
GameObject prefab = GameMgr.GetIns().GetPrefabMgr().Get("Prefab/UI/Menu/CardPanelMaintenancePlate");
|
|
_maintenancePlate = NGUITools.AddChild(base.gameObject, prefab).GetComponent<CardPanelMaintenancePlate>();
|
|
}
|
|
_maintenancePlate.gameObject.SetActive(value: true);
|
|
UIManager.SetObjectToGrey(base.gameObject, b: true);
|
|
UIManager.SetObjectToGrey(_maintenancePlate.gameObject, b: false);
|
|
}
|
|
|
|
private void HideMaintenance()
|
|
{
|
|
if (_maintenancePlate != null)
|
|
{
|
|
_maintenancePlate.gameObject.SetActive(value: false);
|
|
}
|
|
UIManager.SetObjectToGrey(base.gameObject, b: false);
|
|
}
|
|
|
|
public void SetDisableForTutorial(bool isGrey)
|
|
{
|
|
UIManager.SetObjectToGrey(base.gameObject, isGrey);
|
|
}
|
|
|
|
public Vector3 SavePosition()
|
|
{
|
|
_savedPosition = base.transform.localPosition;
|
|
return _savedPosition.Value;
|
|
}
|
|
|
|
public void RestoreSavedPosition()
|
|
{
|
|
base.transform.localPosition = _savedPosition.Value;
|
|
}
|
|
|
|
public IEnumerator DisablePanel(string text)
|
|
{
|
|
ShowMaintenance();
|
|
yield return null;
|
|
_maintenancePlate.SetText(text);
|
|
}
|
|
}
|