222
This commit is contained in:
@@ -765,7 +765,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -132,6 +132,11 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1568052019122780073, guid: 2257ed29939b08f48a2886709375ae69,
|
||||
type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4760332684612964771, guid: 2257ed29939b08f48a2886709375ae69,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
|
||||
1828
Assets/Res/Main/UIPanel/MyNetWorkHUD.prefab
Normal file
1828
Assets/Res/Main/UIPanel/MyNetWorkHUD.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Res/Main/UIPanel/MyNetWorkHUD.prefab.meta
Normal file
7
Assets/Res/Main/UIPanel/MyNetWorkHUD.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88e116a3f2dcd904f921d6470ab2bd6c
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -8,8 +8,8 @@ public class GameStart : MonoBehaviour
|
||||
SceneHandle sceneHandle;
|
||||
void Start()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
StartCoroutine(LoadScene());
|
||||
//StartCoroutine(LoadNetWorkManager());
|
||||
StartCoroutine(LoadUIManager());
|
||||
}
|
||||
IEnumerator LoadScene()
|
||||
@@ -19,6 +19,7 @@ public class GameStart : MonoBehaviour
|
||||
sceneHandle.Completed += (handle) =>
|
||||
{
|
||||
handle.ActivateScene();
|
||||
StartCoroutine(LoadNetWorkHUD());
|
||||
};
|
||||
yield return sceneHandle;
|
||||
}
|
||||
@@ -33,13 +34,12 @@ public class GameStart : MonoBehaviour
|
||||
};
|
||||
yield return _handle;
|
||||
}
|
||||
IEnumerator LoadNetWorkManager()
|
||||
IEnumerator LoadNetWorkHUD()
|
||||
{
|
||||
AssetHandle _handle = YooAssets.LoadAssetAsync<GameObject>("MyRoomManager");
|
||||
AssetHandle _handle = YooAssets.LoadAssetAsync<GameObject>("MyNetWorkHUD");
|
||||
_handle.Completed += (handle) =>
|
||||
{
|
||||
GameObject go = Instantiate((GameObject)_handle.AssetObject);
|
||||
DontDestroyOnLoad(go);
|
||||
GameObject go = Instantiate((GameObject)_handle.AssetObject,GameManager.Inst.MainUICanvas.transform);
|
||||
Debug.Log(_handle.AssetObject);
|
||||
};
|
||||
yield return _handle;
|
||||
@@ -47,7 +47,7 @@ public class GameStart : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if(sceneHandle!=null && !sceneHandle.IsDone)
|
||||
if(sceneHandle!=null && sceneHandle.IsValid)
|
||||
{
|
||||
Debug.Log(sceneHandle.Progress);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Mirror;
|
||||
|
||||
public class MyNetworkManagerHUD : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject startButtonsGroup;
|
||||
[SerializeField] private GameObject statusLabelsGroup;
|
||||
|
||||
[SerializeField] private Button startHostButton;
|
||||
[SerializeField] private Button startServerOnlyButton;
|
||||
[SerializeField] private Button startClientButton;
|
||||
|
||||
[SerializeField] private Button mainStopButton;
|
||||
[SerializeField] private Text mainStopButtonText;
|
||||
[SerializeField] private Button secondaryStopButton;
|
||||
[SerializeField] private Text statusText;
|
||||
|
||||
[SerializeField] private InputField inputNetworkAddress;
|
||||
[SerializeField] private InputField inputPort;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// Init the input field with Network Manager's network address.
|
||||
inputNetworkAddress.text = MyRoomManager.singleton.networkAddress;
|
||||
GetPort();
|
||||
|
||||
RegisterListeners();
|
||||
|
||||
//RegisterClientEvents();
|
||||
|
||||
CheckWebGLPlayer();
|
||||
}
|
||||
|
||||
private void RegisterListeners()
|
||||
{
|
||||
// Add button listeners. These buttons are already added in the inspector.
|
||||
startHostButton.onClick.AddListener(OnClickStartHostButton);
|
||||
startServerOnlyButton.onClick.AddListener(OnClickStartServerButton);
|
||||
startClientButton.onClick.AddListener(OnClickStartClientButton);
|
||||
mainStopButton.onClick.AddListener(OnClickMainStopButton);
|
||||
secondaryStopButton.onClick.AddListener(OnClickSecondaryStopButton);
|
||||
|
||||
// Add input field listener to update NetworkManager's Network Address
|
||||
// when changed.
|
||||
inputNetworkAddress.onValueChanged.AddListener(delegate { OnNetworkAddressChange(); });
|
||||
inputPort.onValueChanged.AddListener(delegate { OnPortChange(); });
|
||||
}
|
||||
|
||||
// Not working at the moment. Can't register events.
|
||||
/*private void RegisterClientEvents()
|
||||
{
|
||||
NetworkClient.OnConnectedEvent += OnClientConnect;
|
||||
NetworkClient.OnDisconnectedEvent += OnClientDisconnect;
|
||||
}*/
|
||||
|
||||
private void CheckWebGLPlayer()
|
||||
{
|
||||
// WebGL can't be host or server.
|
||||
if (Application.platform == RuntimePlatform.WebGLPlayer)
|
||||
{
|
||||
startHostButton.interactable = false;
|
||||
startServerOnlyButton.interactable = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshHUD()
|
||||
{
|
||||
if (!NetworkServer.active && !NetworkClient.isConnected)
|
||||
{
|
||||
StartButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
StatusLabelsAndStopButtons();
|
||||
}
|
||||
}
|
||||
|
||||
private void StartButtons()
|
||||
{
|
||||
if (!NetworkClient.active)
|
||||
{
|
||||
statusLabelsGroup.SetActive(false);
|
||||
startButtonsGroup.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowConnectingStatus();
|
||||
}
|
||||
}
|
||||
|
||||
private void StatusLabelsAndStopButtons()
|
||||
{
|
||||
startButtonsGroup.SetActive(false);
|
||||
statusLabelsGroup.SetActive(true);
|
||||
|
||||
// Host
|
||||
if (NetworkServer.active && NetworkClient.active)
|
||||
{
|
||||
statusText.text = $"<b>Host</b>: running via {Transport.active}";
|
||||
|
||||
mainStopButtonText.text = "Stop Client";
|
||||
}
|
||||
// Server only
|
||||
else if (NetworkServer.active)
|
||||
{
|
||||
statusText.text = $"<b>Server</b>: running via {Transport.active}";
|
||||
|
||||
mainStopButtonText.text = "Stop Server";
|
||||
}
|
||||
// Client only
|
||||
else if (NetworkClient.isConnected)
|
||||
{
|
||||
statusText.text = $"<b>Client</b>: connected to {MyRoomManager.singleton.networkAddress} via {Transport.active}";
|
||||
|
||||
mainStopButtonText.text = "Stop Client";
|
||||
}
|
||||
|
||||
// Note secondary button is only used to Stop Host, and is only needed in host mode.
|
||||
secondaryStopButton.gameObject.SetActive(NetworkServer.active && NetworkClient.active);
|
||||
}
|
||||
|
||||
private void ShowConnectingStatus()
|
||||
{
|
||||
startButtonsGroup.SetActive(false);
|
||||
statusLabelsGroup.SetActive(true);
|
||||
|
||||
secondaryStopButton.gameObject.SetActive(false);
|
||||
|
||||
statusText.text = "Connecting to " + MyRoomManager.singleton.networkAddress + "..";
|
||||
mainStopButtonText.text = "Cancel Connection Attempt";
|
||||
}
|
||||
|
||||
private void OnClickStartHostButton()
|
||||
{
|
||||
OnNetworkAddressChange();
|
||||
MyRoomManager.singleton.StartHost();
|
||||
}
|
||||
|
||||
private void OnClickStartServerButton()
|
||||
{
|
||||
OnNetworkAddressChange();
|
||||
MyRoomManager.singleton.StartServer();
|
||||
}
|
||||
|
||||
private void OnClickStartClientButton()
|
||||
{
|
||||
OnNetworkAddressChange();
|
||||
MyRoomManager.singleton.StartClient();
|
||||
//ShowConnectingStatus();
|
||||
}
|
||||
|
||||
private void OnClickMainStopButton()
|
||||
{
|
||||
if (NetworkClient.active)
|
||||
{
|
||||
MyRoomManager.singleton.StopClient();
|
||||
}
|
||||
else
|
||||
{
|
||||
MyRoomManager.singleton.StopServer();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickSecondaryStopButton()
|
||||
{
|
||||
MyRoomManager.singleton.StopHost();
|
||||
}
|
||||
|
||||
private void OnNetworkAddressChange()
|
||||
{
|
||||
MyRoomManager.singleton.networkAddress = inputNetworkAddress.text;
|
||||
}
|
||||
|
||||
private void OnPortChange()
|
||||
{
|
||||
SetPort(inputPort.text);
|
||||
}
|
||||
|
||||
private void SetPort(string _port)
|
||||
{
|
||||
// only show a port field if we have a port transport
|
||||
// we can't have "IP:PORT" in the address field since this only
|
||||
// works for IPV4:PORT.
|
||||
// for IPV6:PORT it would be misleading since IPV6 contains ":":
|
||||
// 2001:0db8:0000:0000:0000:ff00:0042:8329
|
||||
if (Transport.active is PortTransport portTransport)
|
||||
{
|
||||
// use TryParse in case someone tries to enter non-numeric characters
|
||||
if (ushort.TryParse(_port, out ushort port))
|
||||
portTransport.Port = port;
|
||||
}
|
||||
}
|
||||
|
||||
private void GetPort()
|
||||
{
|
||||
if (Transport.active is PortTransport portTransport)
|
||||
{
|
||||
inputPort.text = portTransport.Port.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
RefreshHUD();
|
||||
}
|
||||
|
||||
/* This does not work because we can't register the handler.
|
||||
void OnClientConnect() {}
|
||||
|
||||
private void OnClientDisconnect()
|
||||
{
|
||||
RefreshHUD();
|
||||
}
|
||||
*/
|
||||
|
||||
// Do a check for the presence of a Network Manager component when
|
||||
// you first add this script to a gameobject.
|
||||
private void Reset()
|
||||
{
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
if (!FindAnyObjectByType<MyRoomManager>())
|
||||
Debug.LogError("This component requires a NetworkManager component to be present in the scene. Please add!");
|
||||
#else
|
||||
// Deprecated in Unity 2023.1
|
||||
if (!FindObjectOfType<NetworkManager>())
|
||||
Debug.LogError("This component requires a NetworkManager component to be present in the scene. Please add!");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44b74d09ae0e6644b88378cbe99e758c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -109,8 +109,8 @@ public class DisplayPanel : MonoBehaviour
|
||||
{
|
||||
if (resolutions == null) return;
|
||||
var settings = SettingsManager.Instance.CurrentSettings;
|
||||
Resolution res = resolutions[resolutions.Length];
|
||||
if (settings.resolutionIndex< resolutions.Length)
|
||||
Resolution res = resolutions[resolutions.Length-1];
|
||||
if (settings.resolutionIndex < resolutions.Length && settings.resolutionIndex>=0)
|
||||
{
|
||||
res = resolutions[settings.resolutionIndex];
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"FileVersion": "1.0.0",
|
||||
"PackageName": "Preload",
|
||||
"PackageVersion": "2025-09-16-921",
|
||||
"PackageVersion": "2025-09-18-573",
|
||||
"Wrappers": [
|
||||
{
|
||||
"BundleGUID": "c9c66be1895c9420aa9b707648d068b7",
|
||||
"FileName": "preload_assets_res_preload_hotupdatedll_c9c66be1895c9420aa9b707648d068b7.bundle"
|
||||
"BundleGUID": "7458991c460107e3f8309942997e4ef8",
|
||||
"FileName": "preload_assets_res_preload_hotupdatedll_7458991c460107e3f8309942997e4ef8.bundle"
|
||||
},
|
||||
{
|
||||
"BundleGUID": "9b7555e356336c15571f80a9ee6d1636",
|
||||
"FileName": "preload_assets_res_preload_uipanel_9b7555e356336c15571f80a9ee6d1636.bundle"
|
||||
"BundleGUID": "098cfc3731c86052bf69752c79b0edc3",
|
||||
"FileName": "preload_assets_res_preload_uipanel_098cfc3731c86052bf69752c79b0edc3.bundle"
|
||||
},
|
||||
{
|
||||
"BundleGUID": "4c4c0accbcb822c3866f82b81fac7328",
|
||||
"FileName": "preload_share_assets_res_preload_uipanelart_4c4c0accbcb822c3866f82b81fac7328.bundle"
|
||||
"BundleGUID": "a949001533c8edf614b0fb29668819e8",
|
||||
"FileName": "preload_share_assets_res_preload_uipanelart_a949001533c8edf614b0fb29668819e8.bundle"
|
||||
},
|
||||
{
|
||||
"BundleGUID": "e142006a171890f235fe2fd7c7bc42e2",
|
||||
"FileName": "preload_unityshaders_e142006a171890f235fe2fd7c7bc42e2.bundle"
|
||||
"BundleGUID": "b22bd6f259bb5385af8d77c440fab2fa",
|
||||
"FileName": "preload_unityshaders_b22bd6f259bb5385af8d77c440fab2fa.bundle"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
2025-09-16-921
|
||||
2025-09-18-573
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
6c535f91
|
||||
BIN
Assets/StreamingAssets/yoo/Preload/Preload_2025-09-18-573.bytes
Normal file
BIN
Assets/StreamingAssets/yoo/Preload/Preload_2025-09-18-573.bytes
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 427820dc3e585344a8b347a517e56963
|
||||
guid: cd268063a21de8848883b60fbad22d72
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -0,0 +1 @@
|
||||
80dffba9
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e62840e2e164e74389aed81be59b809
|
||||
guid: 6cad006d974418e46b29c318378a11d9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 067d81917d68f9b408c0a06c0a97f6fb
|
||||
guid: ec42d9012c96a914cb2e4d3f8edf76db
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbaed440ea729294591435f61c4dbed9
|
||||
guid: e6a67a1f75572574b808aa2f0ebecf11
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7753461638494a841b3261fc21222750
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 749fccc6bd3474447ae4a7088be172f7
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2062ab2bc38f12e4db12646086e2abbb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c436bb467cbef634287847d4dff780b0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/ThirdParty/TextMesh Pro/Fonts/字魂风行手书(商用需授权).ttf
vendored
Normal file
BIN
Assets/ThirdParty/TextMesh Pro/Fonts/字魂风行手书(商用需授权).ttf
vendored
Normal file
Binary file not shown.
21
Assets/ThirdParty/TextMesh Pro/Fonts/字魂风行手书(商用需授权).ttf.meta
vendored
Normal file
21
Assets/ThirdParty/TextMesh Pro/Fonts/字魂风行手书(商用需授权).ttf.meta
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 360a63ffb75b25349ad5e2db49a16b57
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- ZHFXSS_T
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
483
Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/字魂风行手书(商用需授权) SDF.asset
vendored
Normal file
483
Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/字魂风行手书(商用需授权) SDF.asset
vendored
Normal file
File diff suppressed because one or more lines are too long
8
Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/字魂风行手书(商用需授权) SDF.asset.meta
vendored
Normal file
8
Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/字魂风行手书(商用需授权) SDF.asset.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66b3f8a19b52cab478f767ddecd2ca97
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user