任务系统一半多,商城筛选功能,一些细节和免费包
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -12,6 +12,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
{
|
||||
[Header("player unique so")]
|
||||
public Player_SO player_SO;
|
||||
public Text playerCoins_legacy;
|
||||
[Header("put prefabs here")]
|
||||
public GameObject putPrefabsHere;
|
||||
[Header("son buttons")]
|
||||
@@ -97,6 +98,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
// cached reference to the settings instance to ensure only one exists
|
||||
private GameObject settingsInstance;
|
||||
private GameObject storeInstance;
|
||||
private GameObject showLevelInstance;
|
||||
private GameObject emailInstance;
|
||||
private GameObject noticeInstance;
|
||||
@@ -119,6 +121,10 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
void Start()
|
||||
{
|
||||
PlayerEconomyLedger.EnsureInstance().AttachPlayerData(player_SO);
|
||||
PlayerEconomyLedger.EnsureInstance().OnCoinsChanged += HandleCoinsChanged;
|
||||
UpdatePlayerCoinsLegacyText(PlayerEconomyLedger.EnsureInstance().GetCoins());
|
||||
|
||||
if (button_Music == null)
|
||||
{
|
||||
var btn = transform.Find("Button_Music") as RectTransform;
|
||||
@@ -132,15 +138,14 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
}
|
||||
instantiateSettings = () => ToggleSettingsPrefab();
|
||||
instantiateUserInfo = () => { gNotice.recommendation.display("功能即将上线,敬请期待"); };
|
||||
instantiateStore = () => InstantiatePrefab(store_prefab);
|
||||
instantiateStore = () => ShowStorePrefab();
|
||||
instantiateShowLevel = () => { gNotice.error.display("功能即将下线,禁止访问"); };
|
||||
// instantiateShowLevel = () => ShowLevelPrefab();
|
||||
instantiateEmail = () => { gNotice.warning.display("此版本该功能暂不可用"); };
|
||||
// instantiateEmail = () => ShowEmailPrefab();
|
||||
instantiateNotice = () => { gNotice.warning.display("此版本该功能暂不可用"); };
|
||||
instantiateEmail = () => ShowEmailPrefab();
|
||||
instantiateNotice = () => { gNotice.warning.display("姝ょ増鏈鍔熻兘鏆備笉鍙敤"); };
|
||||
// instantiateNotice = () => ShowNoticePrefab();
|
||||
navGuideAction = () => ToggleGuideDisplay();
|
||||
instantiateMarket = () => { gNotice.alarm.display("商店未开放"); };
|
||||
instantiateMarket = () => ShowStorePrefab();
|
||||
|
||||
if (settings_launch != null)
|
||||
settings_launch.onClick.AddListener(instantiateSettings);
|
||||
@@ -412,6 +417,22 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
home_navButton.onClick.RemoveListener(navHomeAction);
|
||||
if (settings_navButton != null && navSettingsAction != null)
|
||||
settings_navButton.onClick.RemoveListener(navSettingsAction);
|
||||
|
||||
if (PlayerEconomyLedger.Instance != null)
|
||||
PlayerEconomyLedger.Instance.OnCoinsChanged -= HandleCoinsChanged;
|
||||
}
|
||||
|
||||
private void HandleCoinsChanged(int coinAmount)
|
||||
{
|
||||
UpdatePlayerCoinsLegacyText(coinAmount);
|
||||
}
|
||||
|
||||
private void UpdatePlayerCoinsLegacyText(int coinAmount)
|
||||
{
|
||||
if (playerCoins_legacy != null)
|
||||
{
|
||||
playerCoins_legacy.text = coinAmount.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleGuideDisplay()
|
||||
@@ -595,6 +616,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
CloseInfoPanels(showLevelInstance);
|
||||
}
|
||||
|
||||
private void ShowStorePrefab()
|
||||
{
|
||||
ShowPrefab(store_prefab, ref storeInstance);
|
||||
CloseInfoPanels(storeInstance);
|
||||
}
|
||||
|
||||
private void ShowEmailPrefab()
|
||||
{
|
||||
ShowPrefab(email_prefab, ref emailInstance);
|
||||
@@ -631,6 +658,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
private void CloseInfoPanels(GameObject keep)
|
||||
{
|
||||
CloseInstance(ref storeInstance, keep);
|
||||
CloseInstance(ref showLevelInstance, keep);
|
||||
CloseInstance(ref emailInstance, keep);
|
||||
CloseInstance(ref noticeInstance, keep);
|
||||
@@ -950,3 +978,4 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user