Compare commits
2 Commits
dba8c4a975
...
da9598e483
Author | SHA1 | Date | |
---|---|---|---|
![]() |
da9598e483 | ||
![]() |
f122a2e268 |
@ -1,5 +1,81 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &2158431407994726238
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 5033446575465077021}
|
||||||
|
- component: {fileID: 5297364674608509923}
|
||||||
|
- component: {fileID: 5572458955095898403}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Mask
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &5033446575465077021
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2158431407994726238}
|
||||||
|
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: 2368487730057768969}
|
||||||
|
m_RootOrder: 0
|
||||||
|
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: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 1920, y: 1080}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &5297364674608509923
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2158431407994726238}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &5572458955095898403
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2158431407994726238}
|
||||||
|
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: 0}
|
||||||
|
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: 0}
|
||||||
|
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 &2368487729476630031
|
--- !u!1 &2368487729476630031
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -468,7 +544,11 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
<<<<<<< HEAD
|
||||||
|
- {fileID: 5033446575465077021}
|
||||||
|
=======
|
||||||
- {fileID: 7697798338937740108}
|
- {fileID: 7697798338937740108}
|
||||||
|
>>>>>>> dba8c4a9750ededdb2198165abaa956cb8527657
|
||||||
- {fileID: 2368487730631202383}
|
- {fileID: 2368487730631202383}
|
||||||
- {fileID: 2368487730040724335}
|
- {fileID: 2368487730040724335}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
|
@ -2577,6 +2577,17 @@ RectTransform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 943987600507664405, guid: 8485410a940aaf94693bababc9830569, type: 3}
|
m_CorrespondingSourceObject: {fileID: 943987600507664405, guid: 8485410a940aaf94693bababc9830569, type: 3}
|
||||||
m_PrefabInstance: {fileID: 199344180}
|
m_PrefabInstance: {fileID: 199344180}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!114 &206701638 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 2613237551241946214, guid: 452c94fdff2ec8b4b8e900c3582bd8d9, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1584174919}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1001 &212712606
|
--- !u!1001 &212712606
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -7562,6 +7573,24 @@ Transform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 471554, guid: 1f0f0623e0b71f84c91c1b6c3c25f82a, type: 3}
|
m_CorrespondingSourceObject: {fileID: 471554, guid: 1f0f0623e0b71f84c91c1b6c3c25f82a, type: 3}
|
||||||
m_PrefabInstance: {fileID: 792124631}
|
m_PrefabInstance: {fileID: 792124631}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &801112008 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 2613237552098030621, guid: 452c94fdff2ec8b4b8e900c3582bd8d9, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1584174919}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!114 &801112010
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 801112008}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 2cec67bcf19f051428de7a00ba1091a1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
pingText: {fileID: 206701638}
|
||||||
--- !u!1 &810501276
|
--- !u!1 &810501276
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -20723,7 +20752,11 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: cbbd01de5b390ce43acc02c7496a905f, type: 3}
|
m_Script: {fileID: 11500000, guid: cbbd01de5b390ce43acc02c7496a905f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
<<<<<<< HEAD
|
||||||
|
connectBtn: {fileID: 0}
|
||||||
|
=======
|
||||||
FreePanel02: {fileID: 6351547}
|
FreePanel02: {fileID: 6351547}
|
||||||
|
>>>>>>> dba8c4a9750ededdb2198165abaa956cb8527657
|
||||||
timerText: {fileID: 510191599}
|
timerText: {fileID: 510191599}
|
||||||
connectBtn: {fileID: 1943285844}
|
connectBtn: {fileID: 1943285844}
|
||||||
--- !u!1 &1584174923 stripped
|
--- !u!1 &1584174923 stripped
|
||||||
|
@ -2,12 +2,18 @@ using System;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEditor.Build.Reporting;
|
using UnityEditor.Build.Reporting;
|
||||||
|
using UnityEditor.UI;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class FreePanel01 : MonoBehaviour
|
public class FreePanel01 : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
public Button connectBtn;
|
||||||
|
=======
|
||||||
public GameObject FreePanel02;
|
public GameObject FreePanel02;
|
||||||
|
>>>>>>> dba8c4a9750ededdb2198165abaa956cb8527657
|
||||||
|
|
||||||
//这里是计时器相关变量
|
//这里是计时器相关变量
|
||||||
public Text timerText;
|
public Text timerText;
|
||||||
@ -21,6 +27,17 @@ public class FreePanel01 : MonoBehaviour
|
|||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
timeElapsed = 0f;
|
timeElapsed = 0f;
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
connectBtn.onClick.AddListener(OnClickConnectBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
//当点击连接通话按钮
|
||||||
|
public void OnClickConnectBtn()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
=======
|
||||||
connectBtn.onClick.AddListener(OnClickConnectBtn);
|
connectBtn.onClick.AddListener(OnClickConnectBtn);
|
||||||
|
|
||||||
|
|
||||||
@ -32,6 +49,7 @@ public class FreePanel01 : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
>>>>>>> dba8c4a9750ededdb2198165abaa956cb8527657
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
44
xiaofang/Assets/Script/hylScripts/PingDisplay.cs
Normal file
44
xiaofang/Assets/Script/hylScripts/PingDisplay.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class PingDisplay : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Text pingText; // 显示延迟的UI Text
|
||||||
|
private int pingValue = 100; // 模拟网络延迟值
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// 更新延迟显示的文字
|
||||||
|
pingText.text = $"网络延迟:{pingValue}ms";
|
||||||
|
|
||||||
|
// 设置文字颜色
|
||||||
|
if (pingValue <= 149)
|
||||||
|
{
|
||||||
|
pingText.color = Color.green; // 绿色
|
||||||
|
}
|
||||||
|
else if (pingValue <= 399)
|
||||||
|
{
|
||||||
|
pingText.color = new Color(1f, 0.92f, 0.016f); // 黄色 (RGB近似)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pingText.color = Color.red; // 红色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPingValue(int _pingValue)
|
||||||
|
{
|
||||||
|
pingValue = _pingValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 模拟获取网络延迟的方法,实际项目中请替换为真实延迟获取逻辑
|
||||||
|
int GetPingValue()
|
||||||
|
{
|
||||||
|
// 示例:随机模拟网络延迟
|
||||||
|
return Random.Range(1, 500);
|
||||||
|
}
|
||||||
|
}
|
11
xiaofang/Assets/Script/hylScripts/PingDisplay.cs.meta
Normal file
11
xiaofang/Assets/Script/hylScripts/PingDisplay.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2cec67bcf19f051428de7a00ba1091a1
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user