feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
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.
This commit is contained in:
177
SVSim.BattleEngine/Engine/Wizard/RankWinnerReward.cs
Normal file
177
SVSim.BattleEngine/Engine/Wizard/RankWinnerReward.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class RankWinnerReward : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private NguiObjs _rewardObjs;
|
||||
|
||||
private GameObject _rewardObject;
|
||||
|
||||
private int _rewardGrade;
|
||||
|
||||
private string _rewardMessage = "";
|
||||
|
||||
private const string ITEM_BOX_FILE_NAME = "box_2pick_{0}_close";
|
||||
|
||||
private List<string> _assetPathList = new List<string>();
|
||||
|
||||
public int RewardGrade => _rewardGrade;
|
||||
|
||||
public string RewardString
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_rewardMessage == "")
|
||||
{
|
||||
_rewardMessage = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING);
|
||||
}
|
||||
return _rewardMessage;
|
||||
}
|
||||
}
|
||||
|
||||
public NguiObjs RewardObjs => _rewardObjs;
|
||||
|
||||
public void SetInfomation(int grade, string message)
|
||||
{
|
||||
UILabel obj = _rewardObjs.labels[0];
|
||||
UISprite uISprite = _rewardObjs.sprites[2];
|
||||
SetRewardString(message);
|
||||
obj.text = _rewardMessage;
|
||||
SetRewardGrade(grade);
|
||||
uISprite.spriteName = GetBoxSpriteName();
|
||||
}
|
||||
|
||||
public void SetRewardGrade(int grade)
|
||||
{
|
||||
_rewardGrade = grade;
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE, grade);
|
||||
}
|
||||
|
||||
public void SetRewardString(string text)
|
||||
{
|
||||
_rewardMessage = text;
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING, text);
|
||||
}
|
||||
|
||||
public IEnumerator ResultWinnerReward()
|
||||
{
|
||||
GameObject obj = Object.Instantiate(Resources.Load("UI/layoutParts/RankWinnerRewardResultPanel")) as GameObject;
|
||||
obj.transform.parent = UIManager.GetInstance().UIManagerRoot.transform;
|
||||
obj.transform.localScale = Vector3.one;
|
||||
_rewardObject = obj;
|
||||
NguiObjs component = _rewardObject.GetComponent<NguiObjs>();
|
||||
UISprite bg = component.sprites[0];
|
||||
UISprite window = component.sprites[1];
|
||||
UISprite box = component.sprites[2];
|
||||
UIManager.GetInstance().AttachAtlas(box.gameObject);
|
||||
UILabel label = component.labels[0];
|
||||
label.text = GameMgr.GetIns()._rankWinnerReward.RewardString;
|
||||
UIPanel panel = _rewardObject.GetComponent<UIPanel>();
|
||||
panel.alpha = 0f;
|
||||
box.spriteName = GetBoxSpriteName();
|
||||
string loadEffectName = "cmn_arena_treasure_" + _rewardGrade;
|
||||
List<string> loadList = new List<string> { Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D) };
|
||||
MonoBehaviour component2 = base.transform.parent.gameObject.GetComponent<MonoBehaviour>();
|
||||
yield return component2.StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(loadList, null));
|
||||
_assetPathList.AddRange(loadList);
|
||||
GameObject treasureEffectObject = Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(loadEffectName, ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)) as GameObject);
|
||||
treasureEffectObject.transform.parent = obj.transform;
|
||||
_assetPathList.AddRange(GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(treasureEffectObject, null));
|
||||
bg.alpha = 0f;
|
||||
box.alpha = 0f;
|
||||
label.alpha = 0f;
|
||||
panel.alpha = 1f;
|
||||
TweenAlpha.Begin(bg.gameObject, 0.5f, 0.65f);
|
||||
TweenAlpha.Begin(label.gameObject, 0.5f, 1f);
|
||||
TweenAlpha.Begin(box.gameObject, 0.5f, 1f);
|
||||
label.transform.localPosition = new Vector3(100f, 0f, 0f);
|
||||
window.transform.localScale = new Vector3(1f, 0.01f, 1f);
|
||||
box.transform.localPosition = new Vector3(180f, 0f, 0f);
|
||||
iTween.MoveTo(label.gameObject, iTween.Hash("x", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.ScaleTo(window.gameObject, iTween.Hash("y", 1f, "time", 0.5f, "easetype", iTween.EaseType.easeInOutExpo));
|
||||
iTween.MoveTo(box.gameObject, iTween.Hash("y", 20f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
yield return new WaitForSeconds(0.8f);
|
||||
TweenAlpha.Begin(label.gameObject, 0.5f, 0f);
|
||||
iTween.MoveTo(box.gameObject, iTween.Hash("x", 0f, "time", 0.7f, "islocal", true, "easetype", iTween.EaseType.easeInOutExpo));
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_2PICK_BOX_OPEN);
|
||||
yield return new WaitForSeconds(1f);
|
||||
treasureEffectObject.transform.localPosition = box.transform.localPosition;
|
||||
treasureEffectObject.transform.localScale = Vector3.one * 320f * 1.75f;
|
||||
treasureEffectObject.SetActive(value: true);
|
||||
box.gameObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
public string GetBoxSpriteName()
|
||||
{
|
||||
return string.Format("box_2pick_{0}_close", (PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE) - 1).ToString("00"));
|
||||
}
|
||||
|
||||
public IEnumerator HideRewardObject()
|
||||
{
|
||||
NguiObjs component = _rewardObject.GetComponent<NguiObjs>();
|
||||
UISprite uISprite = component.sprites[0];
|
||||
UISprite obj = component.sprites[1];
|
||||
TweenAlpha.Begin(uISprite.gameObject, 0.3f, 0f);
|
||||
TweenAlpha.Begin(obj.gameObject, 0.3f, 0f);
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
_rewardObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void RemoveObject()
|
||||
{
|
||||
if (_rewardObject != null)
|
||||
{
|
||||
_rewardObject.SetActive(value: false);
|
||||
}
|
||||
if (_assetPathList.Count > 0)
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_assetPathList);
|
||||
_assetPathList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public Color GetGradeColor()
|
||||
{
|
||||
return _rewardGrade switch
|
||||
{
|
||||
1 => new Color(0.5f, 1f, 0.75f),
|
||||
2 => new Color(1f, 0.85f, 0.25f),
|
||||
3 => new Color(1f, 0.5f, 0.2f),
|
||||
4 => new Color(1f, 0.25f, 0.25f),
|
||||
5 => new Color(0.75f, 0.35f, 1f),
|
||||
6 => Color.white,
|
||||
_ => Color.white,
|
||||
};
|
||||
}
|
||||
|
||||
public Vector3 GetBattleMenuBoxPosition()
|
||||
{
|
||||
return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE) switch
|
||||
{
|
||||
1 => Vector3.up * 4.3f,
|
||||
2 => Vector3.up * 6.8f,
|
||||
3 => Vector3.up * 10.9f,
|
||||
4 => Vector3.up * 10.9f,
|
||||
5 => Vector3.up * 11.9f,
|
||||
6 => Vector3.up * 27.14f,
|
||||
_ => Vector3.up * 27.14f,
|
||||
};
|
||||
}
|
||||
|
||||
public void PlayOpeningSE()
|
||||
{
|
||||
if (PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE) == 6)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SE_SYS_WIN_REWARD_BOX_BIG);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SE_SYS_WIN_REWARD_BOX_SMALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user