装备系统完结,修复并加入很多
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -47,6 +47,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
[SerializeField] Ease prefab_Enter_Ease = Ease.OutCubic;
|
||||
|
||||
[SerializeField] Button button_Idol;
|
||||
[SerializeField] GameObject ui_Panel_Idol;
|
||||
[SerializeField] Button button_Select_Music;
|
||||
[SerializeField] string ui_Select_Music_Scene_Name= "selectYourSongFirst";
|
||||
|
||||
@@ -275,7 +276,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
|
||||
yield return null;
|
||||
|
||||
// 读取保存的角色 ID 并初始化索引
|
||||
// 璇诲彇淇濆瓨鐨勮鑹?ID 骞跺垵濮嬪寲绱㈠紩
|
||||
int savedHeroID = PlayerPrefs.GetInt("SelectedMainHeroID", -1);
|
||||
if (savedHeroID != -1)
|
||||
{
|
||||
@@ -314,14 +315,14 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
button_Story.onClick.AddListener(
|
||||
() =>
|
||||
{
|
||||
gNotice.warning.display("此版本未开放该功能");
|
||||
gNotice.warning.display("姝ょ増鏈湭寮€鏀捐鍔熻兘");
|
||||
//Try_Open_Panel(ui_Panel_Story);
|
||||
});
|
||||
if (button_Idol != null)
|
||||
button_Idol.onClick.AddListener(
|
||||
() =>
|
||||
{
|
||||
gNotice.warning.display("此版本未开放该功能");
|
||||
Toggle_Panel(ui_Panel_Idol);
|
||||
});
|
||||
if (music_Player != null && music_Player.Button_List != null)
|
||||
music_Player.Button_List.onClick.AddListener(
|
||||
@@ -356,6 +357,30 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
return true;
|
||||
}
|
||||
|
||||
void Toggle_Panel(GameObject panel)
|
||||
{
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel.activeSelf)
|
||||
{
|
||||
panel.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel == ui_Panel_Setting)
|
||||
{
|
||||
UI_SettingsPanelEnterAnim enterAnim = panel.GetComponent<UI_SettingsPanelEnterAnim>();
|
||||
if (enterAnim == null)
|
||||
enterAnim = panel.AddComponent<UI_SettingsPanelEnterAnim>();
|
||||
enterAnim.enabled = true;
|
||||
}
|
||||
|
||||
panel.SetActive(true);
|
||||
}
|
||||
|
||||
GameObject Try_Open_Prefab(GameObject prefab, ref GameObject instance)
|
||||
{
|
||||
if (prefab == null) return null;
|
||||
@@ -636,7 +661,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
{
|
||||
hover = startButton.gameObject.AddComponent<UI_StartButtonHover>();
|
||||
}
|
||||
hover.ApplyTexts("执行任务", "Start", "意志复演", "REITERATION OF WILL");
|
||||
hover.ApplyTexts("鎵ц浠诲姟", "Start", "鎰忓織澶嶆紨", "REITERATION OF WILL");
|
||||
}
|
||||
void Setup_RightButtons_Hover()
|
||||
{
|
||||
@@ -771,7 +796,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
c_Character_Illustration_Anim = StartCoroutine(C_Character_Illustration_Anim(canvasGroup, () =>
|
||||
{
|
||||
image_Character.sprite = sprite;
|
||||
// image_Character.SetNativeSize(); // 注释掉 SetNativeSize 以防改变目标图片大小
|
||||
// image_Character.SetNativeSize(); // 娉ㄩ噴鎺?SetNativeSize 浠ラ槻鏀瑰彉鐩爣鍥剧墖澶у皬
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -3562,9 +3587,9 @@ public class UI_JiantouHover : MonoBehaviour, IPointerEnterHandler, IPointerExit
|
||||
|
||||
public class UI_StartButtonHover : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
string offCn = "执行任务";
|
||||
string offCn = "鎵ц浠诲姟";
|
||||
string offEn = "Start";
|
||||
string onCn = "意志复演";
|
||||
string onCn = "鎰忓織澶嶆紨";
|
||||
string onEn = "REITERATION OF WILL";
|
||||
float charInterval = 0.03f;
|
||||
Text cnText;
|
||||
@@ -3719,7 +3744,7 @@ public class UI_StartButtonHover : MonoBehaviour, IPointerEnterHandler, IPointer
|
||||
char[] filler = new char[remain];
|
||||
for (int r = 0; r < remain; r++)
|
||||
{
|
||||
filler[r] = useDot ? '路' : randomChars[(i + r) % randomChars.Length];
|
||||
filler[r] = useDot ? '.' : randomChars[(i + r) % randomChars.Length];
|
||||
}
|
||||
suffix = new string(filler);
|
||||
}
|
||||
|
||||
@@ -1810,6 +1810,126 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &1712207995943947140
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8719722111862639519}
|
||||
- component: {fileID: 5301586153983064217}
|
||||
- component: {fileID: 8236121141998032047}
|
||||
- component: {fileID: 7063352251955770202}
|
||||
m_Layer: 5
|
||||
m_Name: Button_bag
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8719722111862639519
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1712207995943947140}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3304862671657828245}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5301586153983064217
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1712207995943947140}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8236121141998032047
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1712207995943947140}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 687b777ccb26c814f81a7c11655dd300, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 3
|
||||
--- !u!114 &7063352251955770202
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1712207995943947140}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 8236121141998032047}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &1747558998138543452
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4554,7 +4674,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 521.45, y: -43}
|
||||
m_AnchoredPosition: {x: 589.88, y: -43}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!114 &786756074167547563
|
||||
@@ -4948,6 +5068,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
player_SO: {fileID: 11400000, guid: a59c019c71199384eaac0703299047c8, type: 2}
|
||||
playerCoins_legacy: {fileID: 7376147910533281946}
|
||||
player_mmrFragment: {fileID: 1718535194614905540}
|
||||
putPrefabsHere: {fileID: 6773918330215714056}
|
||||
settings_launch: {fileID: 865676738076373517}
|
||||
userInfo_launch: {fileID: 1502937460034745443}
|
||||
@@ -4956,6 +5077,7 @@ MonoBehaviour:
|
||||
email_display: {fileID: 7520904819348953829}
|
||||
notice_display: {fileID: 920723299105391293}
|
||||
market_launch: {fileID: 5379967691629323644}
|
||||
button_userBag: {fileID: 7063352251955770202}
|
||||
userGuideButton: {fileID: 6945238783669072533}
|
||||
guideDisplayImage: {fileID: 2438452334951697137}
|
||||
preIMGb: {fileID: 7091982211545804283}
|
||||
@@ -4989,6 +5111,7 @@ MonoBehaviour:
|
||||
userInfo_prefab: {fileID: 5155954718781159675, guid: 18f4d2367ef2dff429599f1580fd6bad, type: 3}
|
||||
email_prefab: {fileID: 3756075665884320709, guid: 41f4ea31b64f18d48aeef21b79930a6c, type: 3}
|
||||
notice_prefab: {fileID: 8527835049849151044, guid: 06bb6d3a45697374ab4f5ff36356d138, type: 3}
|
||||
userBag_prefab: {fileID: 2826375232361138358, guid: 9e0039d3a46af1c458d7f6e2fc72bab2, type: 3}
|
||||
back_navButton: {fileID: 0}
|
||||
home_navButton: {fileID: 0}
|
||||
settings_navButton: {fileID: 0}
|
||||
@@ -6816,6 +6939,7 @@ RectTransform:
|
||||
- {fileID: 5227902933222757190}
|
||||
- {fileID: 1387828356511308751}
|
||||
- {fileID: 263900830868465045}
|
||||
- {fileID: 8719722111862639519}
|
||||
m_Father: {fileID: 6434860682258445909}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -6846,7 +6970,7 @@ MonoBehaviour:
|
||||
m_CellSize: {x: 50, y: 50}
|
||||
m_Spacing: {x: 20, y: 20}
|
||||
m_Constraint: 1
|
||||
m_ConstraintCount: 5
|
||||
m_ConstraintCount: 6
|
||||
--- !u!1 &7164294745953147232
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -7180,14 +7304,14 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.24705882, g: 0.2901961, b: 0.3372549, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 8442432492524575577, guid: 3a26cd9302ce6db45a1139fc2bb26b66, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 27adfaee3f8bee14280e634021049f50, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
|
||||
@@ -20,6 +20,8 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
[Header("player unique so")]
|
||||
public Player_SO player_SO;
|
||||
public Text playerCoins_legacy;
|
||||
public Text player_mmrFragment;
|
||||
public Text player_rks;
|
||||
[Header("put prefabs here")]
|
||||
public GameObject putPrefabsHere;
|
||||
[Header("son buttons")]
|
||||
@@ -30,6 +32,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
public Button email_display;
|
||||
public Button notice_display;
|
||||
public Button market_launch;
|
||||
public Button button_userBag;
|
||||
|
||||
[Header("User Guide")]
|
||||
[SerializeField] private Button userGuideButton;
|
||||
@@ -62,6 +65,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
public GameObject userInfo_prefab;
|
||||
public GameObject email_prefab;
|
||||
public GameObject notice_prefab;
|
||||
public GameObject userBag_prefab;
|
||||
|
||||
[Header("New Back Buttons")]
|
||||
[SerializeField] private Button back_navButton;
|
||||
@@ -102,6 +106,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
private UnityAction navSettingsAction;
|
||||
private UnityAction navGuideAction;
|
||||
private UnityAction instantiateMarket;
|
||||
private UnityAction instantiateUserBag;
|
||||
|
||||
// cached reference to the settings instance to ensure only one exists
|
||||
private GameObject settingsInstance;
|
||||
@@ -110,6 +115,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
private GameObject showLevelInstance;
|
||||
private GameObject emailInstance;
|
||||
private GameObject noticeInstance;
|
||||
private GameObject userBagInstance;
|
||||
private CanvasGroup musicPicGroup;
|
||||
private Coroutine musicPicFade;
|
||||
private bool musicPicVisible = true;
|
||||
@@ -118,6 +124,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
private bool lastOverlayPanelsVisibilityState;
|
||||
private readonly Dictionary<string, int> guideIndexByScene = new Dictionary<string, int>();
|
||||
private string currentGuideScene = string.Empty;
|
||||
private static btmandtopController activeInstance;
|
||||
|
||||
private static readonly List<string> sceneHistory = new List<string>();
|
||||
private static bool sceneHistoryHooked = false;
|
||||
@@ -125,6 +132,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
void Awake()
|
||||
{
|
||||
activeInstance = this;
|
||||
EnsureMusicPicRoot();
|
||||
InitializeSceneHistoryIfNeeded();
|
||||
}
|
||||
@@ -133,7 +141,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
{
|
||||
PlayerEconomyLedger.EnsureInstance().AttachPlayerData(player_SO);
|
||||
PlayerEconomyLedger.EnsureInstance().OnCoinsChanged += HandleCoinsChanged;
|
||||
PlayerEconomyLedger.EnsureInstance().OnMaterialChanged += HandleMaterialChanged;
|
||||
PlayerRksService.EnsureLoaded(player_SO);
|
||||
PlayerRksService.OnRksChanged += HandleRksChanged;
|
||||
UpdatePlayerCoinsLegacyText(PlayerEconomyLedger.EnsureInstance().GetCoins());
|
||||
UpdatePlayerMmrFragmentText(PlayerEconomyLedger.EnsureInstance().GetMaterial());
|
||||
UpdatePlayerRksText(PlayerRksService.GetBestOverallRks(player_SO));
|
||||
|
||||
if (button_Music == null)
|
||||
{
|
||||
@@ -156,6 +169,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
// instantiateNotice = () => ShowNoticePrefab();
|
||||
navGuideAction = () => ToggleGuideDisplay();
|
||||
instantiateMarket = () => ShowStorePrefab();
|
||||
instantiateUserBag = () => ShowUserBagPrefab();
|
||||
|
||||
if (settings_launch != null)
|
||||
settings_launch.onClick.AddListener(instantiateSettings);
|
||||
@@ -171,6 +185,8 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
notice_display.onClick.AddListener(instantiateNotice);
|
||||
if (market_launch != null)
|
||||
market_launch.onClick.AddListener(instantiateMarket);
|
||||
if (button_userBag != null)
|
||||
button_userBag.onClick.AddListener(instantiateUserBag);
|
||||
if (userGuideButton != null)
|
||||
userGuideButton.onClick.AddListener(navGuideAction);
|
||||
if (preIMGb != null)
|
||||
@@ -473,6 +489,8 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
notice_display.onClick.RemoveListener(instantiateNotice);
|
||||
if (market_launch != null)
|
||||
market_launch.onClick.RemoveListener(instantiateMarket);
|
||||
if (button_userBag != null)
|
||||
button_userBag.onClick.RemoveListener(instantiateUserBag);
|
||||
if (userGuideButton != null)
|
||||
userGuideButton.onClick.RemoveListener(navGuideAction);
|
||||
if (preIMGb != null)
|
||||
@@ -493,7 +511,17 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
settings_navButton.onClick.RemoveListener(navSettingsAction);
|
||||
|
||||
if (PlayerEconomyLedger.Instance != null)
|
||||
{
|
||||
PlayerEconomyLedger.Instance.OnCoinsChanged -= HandleCoinsChanged;
|
||||
PlayerEconomyLedger.Instance.OnMaterialChanged -= HandleMaterialChanged;
|
||||
}
|
||||
|
||||
PlayerRksService.OnRksChanged -= HandleRksChanged;
|
||||
|
||||
if (ReferenceEquals(activeInstance, this))
|
||||
{
|
||||
activeInstance = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleCoinsChanged(int coinAmount)
|
||||
@@ -501,6 +529,16 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
UpdatePlayerCoinsLegacyText(coinAmount);
|
||||
}
|
||||
|
||||
private void HandleMaterialChanged(int materialAmount)
|
||||
{
|
||||
UpdatePlayerMmrFragmentText(materialAmount);
|
||||
}
|
||||
|
||||
private void HandleRksChanged(float rksAmount)
|
||||
{
|
||||
UpdatePlayerRksText(rksAmount);
|
||||
}
|
||||
|
||||
private void UpdatePlayerCoinsLegacyText(int coinAmount)
|
||||
{
|
||||
if (playerCoins_legacy != null)
|
||||
@@ -509,6 +547,46 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePlayerMmrFragmentText(int fragmentAmount)
|
||||
{
|
||||
if (player_mmrFragment != null)
|
||||
{
|
||||
player_mmrFragment.text = fragmentAmount.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePlayerRksText(float rksAmount)
|
||||
{
|
||||
if (player_rks == null)
|
||||
{
|
||||
player_rks = FindLegacyTextByLiteral("player_rks");
|
||||
}
|
||||
|
||||
if (player_rks != null)
|
||||
{
|
||||
player_rks.text = rksAmount.ToString("F2");
|
||||
}
|
||||
}
|
||||
|
||||
private Text FindLegacyTextByLiteral(string literal)
|
||||
{
|
||||
if (string.IsNullOrEmpty(literal))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Text[] texts = GetComponentsInChildren<Text>(true);
|
||||
for (int i = 0; i < texts.Length; i++)
|
||||
{
|
||||
if (texts[i] != null && texts[i].text == literal)
|
||||
{
|
||||
return texts[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void ToggleGuideDisplay()
|
||||
{
|
||||
if (guideDisplayImage == null)
|
||||
@@ -751,7 +829,8 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|| (storeInstance != null && storeInstance.activeInHierarchy)
|
||||
|| (showLevelInstance != null && showLevelInstance.activeInHierarchy)
|
||||
|| (emailInstance != null && emailInstance.activeInHierarchy)
|
||||
|| (noticeInstance != null && noticeInstance.activeInHierarchy);
|
||||
|| (noticeInstance != null && noticeInstance.activeInHierarchy)
|
||||
|| (userBagInstance != null && userBagInstance.activeInHierarchy);
|
||||
}
|
||||
|
||||
private void BroadcastOverlayPanelsVisibility()
|
||||
@@ -764,8 +843,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
private void ShowLevelPrefab()
|
||||
{
|
||||
bool opened = ShowPrefab(showLevel_prefab, ref showLevelInstance);
|
||||
if (opened)
|
||||
if (ToggleIfAlreadyOpen(ref showLevelInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (OpenPrefab(showLevel_prefab, ref showLevelInstance))
|
||||
{
|
||||
CloseInfoPanels(showLevelInstance);
|
||||
}
|
||||
@@ -773,8 +856,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
private void ShowStorePrefab()
|
||||
{
|
||||
bool opened = ShowPrefab(store_prefab, ref storeInstance);
|
||||
if (opened)
|
||||
if (ToggleIfAlreadyOpen(ref storeInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (OpenPrefab(store_prefab, ref storeInstance))
|
||||
{
|
||||
CloseInfoPanels(storeInstance);
|
||||
}
|
||||
@@ -782,8 +869,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
private void ShowEmailPrefab()
|
||||
{
|
||||
bool opened = ShowPrefab(email_prefab, ref emailInstance);
|
||||
if (opened)
|
||||
if (ToggleIfAlreadyOpen(ref emailInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (OpenPrefab(email_prefab, ref emailInstance))
|
||||
{
|
||||
CloseInfoPanels(emailInstance);
|
||||
}
|
||||
@@ -791,14 +882,48 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
private void ShowNoticePrefab()
|
||||
{
|
||||
bool opened = ShowPrefab(notice_prefab, ref noticeInstance);
|
||||
if (opened)
|
||||
if (ToggleIfAlreadyOpen(ref noticeInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (OpenPrefab(notice_prefab, ref noticeInstance))
|
||||
{
|
||||
CloseInfoPanels(noticeInstance);
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShowPrefab(GameObject prefab, ref GameObject instance)
|
||||
private void ShowUserBagPrefab()
|
||||
{
|
||||
if (ToggleIfAlreadyOpen(ref userBagInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (OpenPrefab(userBag_prefab, ref userBagInstance))
|
||||
{
|
||||
CloseInfoPanels(userBagInstance);
|
||||
}
|
||||
}
|
||||
|
||||
private bool ToggleIfAlreadyOpen(ref GameObject instance)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!instance.activeInHierarchy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
instance.SetActive(false);
|
||||
BroadcastOverlayPanelsVisibility();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool OpenPrefab(GameObject prefab, ref GameObject instance)
|
||||
{
|
||||
if (prefab == null || putPrefabsHere == null) return false;
|
||||
|
||||
@@ -816,14 +941,16 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
}
|
||||
}
|
||||
|
||||
bool shouldOpen = !instance.activeSelf;
|
||||
instance.SetActive(shouldOpen);
|
||||
if (!shouldOpen)
|
||||
if (instance == null)
|
||||
{
|
||||
BroadcastOverlayPanelsVisibility();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!instance.activeSelf)
|
||||
{
|
||||
instance.SetActive(true);
|
||||
}
|
||||
|
||||
PlacePanelBelowSettings(instance);
|
||||
BroadcastOverlayPanelsVisibility();
|
||||
return true;
|
||||
@@ -868,6 +995,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
CloseInstance(ref showLevelInstance, keep);
|
||||
CloseInstance(ref emailInstance, keep);
|
||||
CloseInstance(ref noticeInstance, keep);
|
||||
CloseInstance(ref userBagInstance, keep);
|
||||
}
|
||||
|
||||
private void CloseInstance(ref GameObject instance, GameObject keep)
|
||||
@@ -915,6 +1043,18 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static void RefreshOverlayVisibilityState()
|
||||
{
|
||||
if (activeInstance != null)
|
||||
{
|
||||
activeInstance.BroadcastOverlayPanelsVisibility();
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentOverlayPanelsVisible = false;
|
||||
GlobalOverlayPanelVisibilityChanged?.Invoke(false);
|
||||
}
|
||||
|
||||
private void InstantiatePrefab(GameObject prefab)
|
||||
{
|
||||
if (prefab != null && putPrefabsHere != null)
|
||||
|
||||
Reference in New Issue
Block a user