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.
70 lines
2.0 KiB
C#
70 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Cute;
|
|
using UnityEngine;
|
|
|
|
namespace Wizard;
|
|
|
|
public class QuestCampaignDialog : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private UITexture _texture;
|
|
|
|
private Action _onTweet;
|
|
|
|
private List<string> _loadPathList = new List<string>();
|
|
|
|
private string GetTexturePath(bool isFetch)
|
|
{
|
|
return Toolbox.ResourcesManager.GetAssetTypePath("quest_dialog_0013", ResourcesManager.AssetLoadPathType.UiOtherTexture, isFetch);
|
|
}
|
|
|
|
public static void Create(Action onFinish, Action onTweet = null)
|
|
{
|
|
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
|
dialogBase.SetTitleLabel(Data.SystemText.Get("BossRush_0046"));
|
|
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn);
|
|
dialogBase.SetButtonText(Data.SystemText.Get("Mission_0109"), Data.SystemText.Get("Common_0008"));
|
|
dialogBase.SetSize(DialogBase.Size.M);
|
|
GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/layoutParts/BossRush/QuestCampaignDialog")) as GameObject;
|
|
dialogBase.SetObj(gameObject);
|
|
QuestCampaignDialog component = gameObject.GetComponent<QuestCampaignDialog>();
|
|
component.Initialize(dialogBase);
|
|
component._onTweet = onTweet;
|
|
dialogBase.OnClose = delegate
|
|
{
|
|
onFinish.Call();
|
|
};
|
|
}
|
|
|
|
private void Initialize(DialogBase dialog)
|
|
{
|
|
dialog.onPushButton1 = (Action)Delegate.Combine(dialog.onPushButton1, (Action)delegate
|
|
{
|
|
OnClickTwitterShare();
|
|
});
|
|
Load(delegate
|
|
{
|
|
_texture.mainTexture = Toolbox.ResourcesManager.LoadObject(GetTexturePath(isFetch: true)) as Texture;
|
|
});
|
|
}
|
|
|
|
private void Load(Action onFinish)
|
|
{
|
|
_loadPathList.Add(GetTexturePath(isFetch: false));
|
|
StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadPathList, delegate
|
|
{
|
|
onFinish.Call();
|
|
}));
|
|
}
|
|
|
|
private void OnClickTwitterShare()
|
|
{
|
|
QuestTweetTask task = new QuestTweetTask();
|
|
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
|
{
|
|
_onTweet.Call();
|
|
}));
|
|
}
|
|
}
|