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.
112 lines
2.5 KiB
C#
112 lines
2.5 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace Wizard;
|
|
|
|
public class ShopPanelAppealItem : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private GameObject _rootAppealObj;
|
|
|
|
[SerializeField]
|
|
private GameObject _objNewMark;
|
|
|
|
[SerializeField]
|
|
private UILabel _labelRemainTime;
|
|
|
|
[SerializeField]
|
|
[Tooltip("残り{0}日")]
|
|
private string _remainDayTextId = "MyPage_0062";
|
|
|
|
[SerializeField]
|
|
[Tooltip("残り{0}時間")]
|
|
private string _remainHourTextId = "MyPage_0063";
|
|
|
|
[SerializeField]
|
|
[Tooltip("残り{0}分")]
|
|
private string _remainMinuteTextId = "MyPage_0064";
|
|
|
|
public void SetActiveAppealObj(bool isActive)
|
|
{
|
|
_rootAppealObj.SetActive(isActive);
|
|
}
|
|
|
|
public void DelaySetActiveAppealObj(bool isActive, float delayTime)
|
|
{
|
|
if (base.gameObject.activeInHierarchy)
|
|
{
|
|
StartCoroutine(DelaySetActiveCoroutin(isActive, delayTime));
|
|
}
|
|
}
|
|
|
|
private IEnumerator DelaySetActiveCoroutin(bool isActive, float delayTime)
|
|
{
|
|
yield return new WaitForSeconds(delayTime);
|
|
SetActiveAppealObj(isActive);
|
|
}
|
|
|
|
public void SetAppeal(ShopNotification.ShopAppealInfo appealInfo)
|
|
{
|
|
if (appealInfo.NeedsCampaignDisplay)
|
|
{
|
|
SetCampaignDisplay();
|
|
SetActiveNewMark(appealInfo.IsNew);
|
|
}
|
|
else if (appealInfo.RemainTime != null)
|
|
{
|
|
SetRemainTimeLabel(appealInfo.RemainTime.Second);
|
|
SetActiveNewMark(isActive: false);
|
|
}
|
|
else
|
|
{
|
|
SetActiveNewMark(appealInfo.IsNew);
|
|
SetActiveRemainTime(isActive: false);
|
|
}
|
|
}
|
|
|
|
public void SetActiveNewMark(bool isActive)
|
|
{
|
|
_objNewMark?.SetActive(isActive);
|
|
}
|
|
|
|
public void SetActiveRemainTime(bool isActive)
|
|
{
|
|
_labelRemainTime?.gameObject.SetActive(isActive);
|
|
}
|
|
|
|
private void SetRemainTimeLabel(int limitTime)
|
|
{
|
|
if (_labelRemainTime == null)
|
|
{
|
|
return;
|
|
}
|
|
if (limitTime <= 0)
|
|
{
|
|
_labelRemainTime.gameObject.SetActive(value: false);
|
|
return;
|
|
}
|
|
_labelRemainTime.gameObject.SetActive(value: true);
|
|
SystemText systemText = Data.SystemText;
|
|
if (limitTime < 3600)
|
|
{
|
|
int num = limitTime / 60 + 1;
|
|
_labelRemainTime.text = systemText.Get(_remainMinuteTextId, num.ToString());
|
|
}
|
|
else if (limitTime < 86400)
|
|
{
|
|
int num2 = limitTime / 3600;
|
|
_labelRemainTime.text = systemText.Get(_remainHourTextId, num2.ToString());
|
|
}
|
|
else
|
|
{
|
|
int num3 = limitTime / 86400;
|
|
_labelRemainTime.text = systemText.Get(_remainDayTextId, num3.ToString());
|
|
}
|
|
}
|
|
|
|
private void SetCampaignDisplay()
|
|
{
|
|
_labelRemainTime.text = Data.SystemText.Get("MyPage_0076");
|
|
}
|
|
}
|