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.
48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cute;
|
|
using UnityEngine;
|
|
|
|
namespace Wizard;
|
|
|
|
public static class ColorCode
|
|
{
|
|
public const string MASTER_NAME = "color_code";
|
|
|
|
private const char INFO_DELIMITER = ':';
|
|
|
|
private static Dictionary<eColorCodeId, Color> _colorCodeDic = new Dictionary<eColorCodeId, Color>();
|
|
|
|
public static void BuildData()
|
|
{
|
|
string[] array = (Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("color_code", ResourcesManager.AssetLoadPathType.MasterEtc, isfetch: true)) as TextAsset).text.Trim().Replace("\r", "").Split('\n');
|
|
for (int i = 0; i < array.Length; i++)
|
|
{
|
|
string[] array2 = array[i].Split(':');
|
|
if (Enum.TryParse<eColorCodeId>(array2[0], out var result))
|
|
{
|
|
ColorUtility.TryParseHtmlString(array2[1], out var color);
|
|
_colorCodeDic[result] = color;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static Color GetWithString(string id)
|
|
{
|
|
if (Enum.TryParse<eColorCodeId>(id, out var result))
|
|
{
|
|
return Get(result);
|
|
}
|
|
return Color.red;
|
|
}
|
|
|
|
public static Color Get(eColorCodeId id)
|
|
{
|
|
if (_colorCodeDic.TryGetValue(id, out var value))
|
|
{
|
|
return value;
|
|
}
|
|
return Color.red;
|
|
}
|
|
}
|