功能批量实现 优化 服务端 新浮动小游戏框架 新界面UI
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,8 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
[SerializeField] GameObject ui_Panel_Story;
|
||||
[SerializeField] Button button_Setting;
|
||||
[SerializeField] GameObject ui_Panel_Setting;
|
||||
[SerializeField] Button button_worldChat;
|
||||
[SerializeField] GameObject worldChatObject;
|
||||
[SerializeField] float prefab_Enter_Time = 0.35f;
|
||||
[SerializeField] float prefab_Enter_Scale_From = 0.92f;
|
||||
[SerializeField] Ease prefab_Enter_Ease = Ease.OutCubic;
|
||||
@@ -330,6 +332,11 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
if (button_Setting != null)
|
||||
button_Setting.onClick.AddListener(
|
||||
() => Try_Open_Panel(ui_Panel_Setting));
|
||||
if (worldChatObject != null)
|
||||
worldChatObject.SetActive(false);
|
||||
if (button_worldChat != null && worldChatObject != null)
|
||||
button_worldChat.onClick.AddListener(
|
||||
() => worldChatObject.SetActive(true));
|
||||
|
||||
|
||||
if (button_Select_Music != null)
|
||||
|
||||
@@ -3098,7 +3098,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &7476805877805305379
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3115,10 +3115,10 @@ RectTransform:
|
||||
- {fileID: 2515611058996813551}
|
||||
m_Father: {fileID: 7912636600211646566}
|
||||
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_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 95, y: -25}
|
||||
m_SizeDelta: {x: 50, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8613954281550256410
|
||||
CanvasRenderer:
|
||||
@@ -4105,7 +4105,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &3878110758398832463
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4121,10 +4121,10 @@ RectTransform:
|
||||
- {fileID: 2099305528324639673}
|
||||
m_Father: {fileID: 7912636600211646566}
|
||||
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_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 25, y: -25}
|
||||
m_SizeDelta: {x: 50, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2846323317655161991
|
||||
CanvasRenderer:
|
||||
@@ -5113,6 +5113,7 @@ MonoBehaviour:
|
||||
email_prefab: {fileID: 3756075665884320709, guid: 41f4ea31b64f18d48aeef21b79930a6c, type: 3}
|
||||
notice_prefab: {fileID: 8527835049849151044, guid: 06bb6d3a45697374ab4f5ff36356d138, type: 3}
|
||||
userBag_prefab: {fileID: 2826375232361138358, guid: 9e0039d3a46af1c458d7f6e2fc72bab2, type: 3}
|
||||
mailRedPot: {fileID: 5835331043321630532}
|
||||
back_navButton: {fileID: 0}
|
||||
home_navButton: {fileID: 0}
|
||||
settings_navButton: {fileID: 0}
|
||||
@@ -6126,6 +6127,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 7514224236584078014}
|
||||
- {fileID: 4607317886706537962}
|
||||
- {fileID: 1145193307346210204}
|
||||
m_Father: {fileID: 7912636600211646566}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -6602,6 +6604,81 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &6847515371386411778
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1145193307346210204}
|
||||
- component: {fileID: 4536071255097187218}
|
||||
- component: {fileID: 5835331043321630532}
|
||||
m_Layer: 5
|
||||
m_Name: new
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1145193307346210204
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6847515371386411778}
|
||||
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: 8079540942653106974}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 21.9, y: 21.3}
|
||||
m_SizeDelta: {x: 15.8354, y: 15.8355}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4536071255097187218
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6847515371386411778}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5835331043321630532
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6847515371386411778}
|
||||
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: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: bef5646fb83a6a54f9b2720dc36259f3, 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: 1
|
||||
--- !u!1 &6924915827096337323
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine.Audio;
|
||||
using Bansonic;
|
||||
using Steamworks;
|
||||
using GameServer.Client;
|
||||
|
||||
public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
{
|
||||
@@ -67,6 +68,9 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
public GameObject notice_prefab;
|
||||
public GameObject userBag_prefab;
|
||||
|
||||
[Header("mail red pot")]
|
||||
public Image mailRedPot;
|
||||
|
||||
[Header("New Back Buttons")]
|
||||
[SerializeField] private Button back_navButton;
|
||||
[SerializeField] private Button home_navButton;
|
||||
@@ -204,6 +208,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
button_Music.onClick.AddListener(ToggleMusicPicLocal);
|
||||
|
||||
UpdateSteamUserInfo();
|
||||
InitializeMailRedPot();
|
||||
|
||||
var binder = BgmUiBinder.Instance != null ? BgmUiBinder.Instance : Object.FindAnyObjectByType<BgmUiBinder>();
|
||||
if (binder != null && musicPicRoot != null)
|
||||
@@ -517,6 +522,11 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
}
|
||||
|
||||
PlayerRksService.OnRksChanged -= HandleRksChanged;
|
||||
UI_Panel_Mail.OnUnreadStateChanged -= HandleMailUnreadStateChanged;
|
||||
if (MailHttpService.Instance != null)
|
||||
{
|
||||
MailHttpService.Instance.OnMailListChanged -= HandleMailListChanged;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(activeInstance, this))
|
||||
{
|
||||
@@ -539,6 +549,65 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
UpdatePlayerRksText(rksAmount);
|
||||
}
|
||||
|
||||
private void InitializeMailRedPot()
|
||||
{
|
||||
if (mailRedPot == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool useServerMail = false;
|
||||
if (email_prefab != null)
|
||||
{
|
||||
UI_Panel_Mail mailPanel = email_prefab.GetComponent<UI_Panel_Mail>();
|
||||
if (mailPanel != null)
|
||||
{
|
||||
useServerMail = mailPanel.UsesServerMail;
|
||||
}
|
||||
}
|
||||
|
||||
if (useServerMail && MailHttpService.Instance != null)
|
||||
{
|
||||
MailHttpService.Instance.SetServerModeEnabled(true);
|
||||
MailHttpService.Instance.OnMailListChanged -= HandleMailListChanged;
|
||||
MailHttpService.Instance.OnMailListChanged += HandleMailListChanged;
|
||||
}
|
||||
|
||||
UI_Panel_Mail.OnUnreadStateChanged -= HandleMailUnreadStateChanged;
|
||||
UI_Panel_Mail.OnUnreadStateChanged += HandleMailUnreadStateChanged;
|
||||
UpdateMailRedPot();
|
||||
}
|
||||
|
||||
private void HandleMailUnreadStateChanged()
|
||||
{
|
||||
UpdateMailRedPot();
|
||||
}
|
||||
|
||||
private void HandleMailListChanged(IReadOnlyList<MailApiEntry> _)
|
||||
{
|
||||
UpdateMailRedPot();
|
||||
}
|
||||
|
||||
private void UpdateMailRedPot()
|
||||
{
|
||||
if (mailRedPot == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool useServerMail = false;
|
||||
if (email_prefab != null)
|
||||
{
|
||||
UI_Panel_Mail mailPanel = email_prefab.GetComponent<UI_Panel_Mail>();
|
||||
if (mailPanel != null)
|
||||
{
|
||||
useServerMail = mailPanel.UsesServerMail;
|
||||
}
|
||||
}
|
||||
|
||||
mailRedPot.enabled = UI_Panel_Mail.HasUnreadMails(useServerMail);
|
||||
}
|
||||
|
||||
private void UpdatePlayerCoinsLegacyText(int coinAmount)
|
||||
{
|
||||
if (playerCoins_legacy != null)
|
||||
|
||||
Reference in New Issue
Block a user