阶段备份3

This commit is contained in:
XgC2961 2025-08-30 08:52:30 +08:00
parent 0e541101db
commit 43d7052963
10 changed files with 946 additions and 253 deletions

View File

@ -1009,6 +1009,7 @@ GameObject:
m_Component:
- component: {fileID: 147885631}
- component: {fileID: 147885632}
- component: {fileID: 147885633}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged
@ -1084,7 +1085,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1206650072}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_MaxValue: 100
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
@ -1102,6 +1103,35 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &147885633
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 147885630}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 14
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnSliderEndDrag
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &149928848
GameObject:
m_ObjectHideFlags: 0
@ -1905,7 +1935,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &255454897
RectTransform:
m_ObjectHideFlags: 0
@ -2248,6 +2278,7 @@ GameObject:
m_Component:
- component: {fileID: 323632687}
- component: {fileID: 323632688}
- component: {fileID: 323632689}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged
@ -2323,7 +2354,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 838312354}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_MaxValue: 100
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
@ -2341,6 +2372,35 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &323632689
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 323632686}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 14
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnSliderEndDrag
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &337630845
GameObject:
m_ObjectHideFlags: 0
@ -4588,14 +4648,14 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnButtonClick_Anim
m_MethodName: OnButtonClick_PlayModel
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: "\u6574\u4F53\u7ED3\u6784\u5C55\u793A"
m_StringArgument: "\u5E8A\u53F0\u7CFB\u7EDF"
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &588168071
@ -5618,14 +5678,14 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnButtonClick_Anim
m_MethodName: OnButtonClick_PlayModel
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: "\u6574\u4F53\u7ED3\u6784\u5C55\u793A"
m_StringArgument: "CT\u7CFB\u7EDF"
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &857052105
@ -5970,7 +6030,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &918998978
RectTransform:
m_ObjectHideFlags: 0
@ -6201,6 +6261,7 @@ GameObject:
m_Component:
- component: {fileID: 965406577}
- component: {fileID: 965406578}
- component: {fileID: 965406579}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged
@ -6276,7 +6337,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 84517325}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_MaxValue: 100
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
@ -6287,13 +6348,42 @@ MonoBehaviour:
m_MethodName: OnSliderChanged
m_Mode: 2
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgument: {fileID: 965406578}
m_ObjectArgumentAssemblyTypeName: UnityEngine.UI.Slider, UnityEngine.UI
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &965406579
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 965406576}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 14
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnSliderEndDrag
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &970197317
GameObject:
m_ObjectHideFlags: 0
@ -6493,14 +6583,14 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnButtonClick_Anim
m_MethodName: OnButtonClick_PlayModel
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: "\u6574\u4F53\u7ED3\u6784\u5C55\u793A"
m_StringArgument: PET
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1024400632
@ -8234,7 +8324,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 6, y: 0}
m_SizeDelta: {x: 54.2549, y: -14.6958}
m_Pivot: {x: 0.5, y: 0.5}
@ -8695,14 +8785,14 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnButtonClick_Anim
m_MethodName: OnButtonClick_PlayModel
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: "\u6574\u4F53\u7ED3\u6784\u5C55\u793A"
m_StringArgument: SPECT
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1238533519
@ -10050,7 +10140,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
@ -10178,7 +10268,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnButtonClick_Anim
m_MethodName: OnButtonClick_PlayModel
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
@ -11741,14 +11831,14 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnButtonClick_Anim
m_MethodName: OnButtonClick_PlayModel
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: "\u6574\u4F53\u7ED3\u6784\u5C55\u793A"
m_StringArgument: "\u673A\u67B6\u7CFB\u7EDF"
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1866139834
@ -12439,6 +12529,7 @@ GameObject:
m_Component:
- component: {fileID: 2048917857}
- component: {fileID: 2048917858}
- component: {fileID: 2048917859}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged
@ -12514,7 +12605,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 527617392}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_MaxValue: 100
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
@ -12532,6 +12623,35 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &2048917859
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2048917856}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 14
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnSliderEndDrag
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &2062396200
GameObject:
m_ObjectHideFlags: 0
@ -12896,6 +13016,7 @@ GameObject:
m_Component:
- component: {fileID: 2094144141}
- component: {fileID: 2094144142}
- component: {fileID: 2094144143}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged
@ -12971,7 +13092,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 195234605}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_MaxValue: 100
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
@ -12989,6 +13110,35 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &2094144143
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2094144140}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates:
- eventID: 14
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2109707620}
m_TargetAssemblyTypeName: TouchClient, Assembly-CSharp
m_MethodName: OnSliderEndDrag
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &2094264359
GameObject:
m_ObjectHideFlags: 0
@ -13329,12 +13479,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 1920, y: 1080}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_MatchWidthOrHeight: 0.5
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96

View File

@ -525,7 +525,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c86ed53e8144b2b4781bab9d7e73c21e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultAnimName: Idle
defaultAnimName: Take 001
--- !u!1 &497933936
GameObject:
m_ObjectHideFlags: 0
@ -613,10 +613,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 3328, y: 1352}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
@ -938,7 +938,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c86ed53e8144b2b4781bab9d7e73c21e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultAnimName: Idle
defaultAnimName: Take 001
--- !u!1 &705507993
GameObject:
m_ObjectHideFlags: 0
@ -1068,7 +1068,7 @@ RectTransform:
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_AnchoredPosition: {x: 0, y: -7}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &943449934
@ -1224,7 +1224,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c86ed53e8144b2b4781bab9d7e73c21e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultAnimName: Idle
defaultAnimName: Take 001
--- !u!1 &1151435827
GameObject:
m_ObjectHideFlags: 0
@ -1477,7 +1477,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c86ed53e8144b2b4781bab9d7e73c21e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultAnimName: Idle
defaultAnimName: Take 001
--- !u!1001 &1681616358
PrefabInstance:
m_ObjectHideFlags: 0
@ -1485,6 +1485,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 586304722}
m_Modifications:
- target: {fileID: 2088313044, guid: 56ad479e7b7393943899010515c51f96, type: 3}
propertyPath: defaultAnimName
value: Take 001
objectReference: {fileID: 0}
- target: {fileID: 3868356453414391042, guid: 56ad479e7b7393943899010515c51f96, type: 3}
propertyPath: m_RootOrder
value: 0
@ -1731,7 +1735,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c86ed53e8144b2b4781bab9d7e73c21e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultAnimName: Idle
defaultAnimName: Take 001
--- !u!1 &2139815134
GameObject:
m_ObjectHideFlags: 0

View File

@ -3,54 +3,77 @@ using System.Net.Sockets;
using System.Net;
using System.Text;
using System.Threading;
using System;
public class BroadcastServer : MonoBehaviour
{
private UdpClient udpBroadcaster;
private Thread broadcastThread;
private bool isRunning = true;
private UdpClient udpBroadcaster; // 用于广播本地IP的UDP客户端
private Thread broadcastThread; // 运行广播循环的线程
private CancellationTokenSource cts = new CancellationTokenSource(); // 控制线程取消
private volatile bool isRunning = true; // 控制广播循环的线程安全标志
// 脚本启动时调用
void Start()
{
// 初始化UDP客户端并启用广播
udpBroadcaster = new UdpClient();
udpBroadcaster.EnableBroadcast = true;
broadcastThread = new Thread(BroadcastIP);
// 启动新线程以广播本地IP
broadcastThread = new Thread(() => BroadcastIP(cts.Token));
broadcastThread.Start();
Debug.Log("ÏÔʾ¶ËÕýÔڹ㲥IP...");
}
private void BroadcastIP()
// 定期广播本地IP地址
private void BroadcastIP(CancellationToken token)
{
// 定义广播端点IP: 255.255.255.255,端口: 9999
IPEndPoint endPoint = new IPEndPoint(IPAddress.Broadcast, 9999);
string localIP = GetLocalIPAddress();
string localIP = GetLocalIPAddress(); // 获取本地IPv4地址
while (isRunning)
// 在未取消的情况下持续广播
while (!token.IsCancellationRequested && isRunning)
{
byte[] data = Encoding.UTF8.GetBytes(localIP);
udpBroadcaster.Send(data, data.Length, endPoint);
Thread.Sleep(1000);
try
{
// 将IP地址转换为字节并通过UDP发送
byte[] data = Encoding.UTF8.GetBytes(localIP);
udpBroadcaster.Send(data, data.Length, endPoint);
Thread.Sleep(2000); // 每2秒广播一次减少网络负载
}
catch (Exception ex)
{
Debug.LogError($"广播错误: {ex.Message}");
}
}
}
// 获取本机的IPv4地址
private string GetLocalIPAddress()
{
string localIP = "127.0.0.1";
string localIP = "127.0.0.1"; // 如果未找到有效IP则回退到本地回环地址
foreach (var ip in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip.ToString();
localIP = ip.ToString(); // 使用找到的第一个IPv4地址
break;
}
}
return localIP;
}
// 应用程序退出时清理资源
private void OnApplicationQuit()
{
isRunning = false;
udpBroadcaster?.Close();
isRunning = false; // 通知广播循环停止
cts.Cancel(); // 请求线程取消
udpBroadcaster?.Close(); // 关闭UDP客户端
if (broadcastThread != null && broadcastThread.IsAlive)
{
broadcastThread.Join(1000); // 等待线程结束超时1秒
}
}
}
}

View File

@ -4,106 +4,191 @@ using System.Net;
using System.Text;
using System.Threading;
using System.Collections.Generic;
using System;
public class DisplayServer : MonoBehaviour
{
private TcpListener listener;
private Thread listenThread;
private bool isRunning = true;
private TcpListener listener; // 用于接受客户端连接的TCP监听器
private Thread listenThread; // 用于接受客户端连接的线程
private CancellationTokenSource listenCts = new CancellationTokenSource(); // 控制线程取消
private volatile bool isRunning = true; // 线程安全的服务器循环标志
private NetworkStream clientStream; // 当前客户端的网络流,用于发送消息
public Transform background;
public Transform background; // UI页面的父级变换
[System.Serializable]
public class PageModel
{
public string pageName;
public GameObject model; // 模型上挂载 ModelController
public string pageName; // 页面名称
public GameObject model; // 与页面关联的模型挂载ModelController
}
public List<PageModel> pageModels = new List<PageModel>();
public List<PageModel> pageModels = new List<PageModel>(); // 页面-模型映射列表
private string latestMsg = "";
private string currentPage = "";
private readonly Queue<string> messageQueue = new Queue<string>(); // 线程安全的消息队列
private readonly object queueLock = new object(); // 消息队列访问锁
private string currentPage = ""; // 跟踪当前显示的页面
private Dictionary<string, PageModel> pageModelCache; // 页面-模型映射的缓存
// 脚本启动时调用
void Start()
{
// 设置显示端分辨率为 3328x1352
Screen.SetResolution(3328, 1352, false);
// 初始化页面-模型缓存以加快查找
pageModelCache = new Dictionary<string, PageModel>();
foreach (var pm in pageModels)
{
if (!string.IsNullOrEmpty(pm.pageName) && pm.model != null)
{
pageModelCache[pm.pageName] = pm;
}
}
// 在端口8888上启动TCP监听
listener = new TcpListener(IPAddress.Any, 8888);
listener.Start();
listenThread = new Thread(ListenForClients);
// 启动线程以监听客户端连接
listenThread = new Thread(() => ListenForClients(listenCts.Token));
listenThread.Start();
Debug.Log("显示端服务器已启动,等待触摸端连接...");
// 显示初始页面
ShowPage("首页");
}
private void ListenForClients()
// 监听传入的TCP客户端连接
private void ListenForClients(CancellationToken token)
{
while (isRunning)
while (!token.IsCancellationRequested && isRunning)
{
TcpClient client = listener.AcceptTcpClient();
Debug.Log("触摸端已连接!");
Thread clientThread = new Thread(HandleClientComm);
clientThread.Start(client);
try
{
TcpClient client = listener.AcceptTcpClient();
Debug.Log("触摸端已连接!");
clientStream = client.GetStream(); // 保存客户端流以发送消息
// 为每个客户端启动新线程处理通信
Thread clientThread = new Thread(() => HandleClientComm(client, token));
clientThread.Start();
}
catch (Exception ex)
{
Debug.LogError($"接受客户端连接错误: {ex.Message}");
}
}
}
private void HandleClientComm(object clientObj)
// 处理与单个客户端的通信
private void HandleClientComm(TcpClient tcpClient, CancellationToken token)
{
TcpClient tcpClient = (TcpClient)clientObj;
NetworkStream clientStream = tcpClient.GetStream();
NetworkStream stream = tcpClient.GetStream();
byte[] message = new byte[4096];
int bytesRead;
while (isRunning)
// 在未取消或未断开连接的情况下持续读取
while (!token.IsCancellationRequested && isRunning)
{
try { bytesRead = clientStream.Read(message, 0, 4096); }
catch { break; }
if (bytesRead == 0) break;
string data = Encoding.UTF8.GetString(message, 0, bytesRead);
latestMsg = data;
}
tcpClient.Close();
}
private void Update()
{
if (string.IsNullOrEmpty(latestMsg)) return;
if (latestMsg.StartsWith("Page:"))
{
string pageName = latestMsg.Replace("Page:", "");
ShowPage(pageName);
}
else if (latestMsg.StartsWith("Model:")) // 改成根据模型名播放动画
{
string modelName = latestMsg.Replace("Model:", "");
PlayModelAnimation(modelName);
}
else if (latestMsg.StartsWith("Progress:"))
{
if (float.TryParse(latestMsg.Replace("Progress:", ""), out float progress))
try
{
SetAnimationProgress(progress);
bytesRead = stream.Read(message, 0, 4096);
if (bytesRead == 0) break; // 客户端断开连接
string data = Encoding.UTF8.GetString(message, 0, bytesRead);
lock (queueLock)
{
messageQueue.Enqueue(data); // 将消息加入队列以供处理
}
}
catch (Exception ex)
{
Debug.LogError($"读取客户端消息错误: {ex.Message}");
break;
}
}
latestMsg = "";
// 清理客户端资源
stream.Close();
tcpClient.Close();
clientStream = null; // 清空客户端流
Debug.Log("客户端断开连接");
}
// 在主线程中处理排队的消息并发送动画进度
private void Update()
{
// 处理接收到的消息
string msg = null;
lock (queueLock)
{
if (messageQueue.Count > 0)
{
msg = messageQueue.Dequeue(); // 获取下一条消息
}
}
if (!string.IsNullOrEmpty(msg))
{
Debug.Log($"收到消息: {msg}");
if (msg.StartsWith("Page:"))
{
string pageName = msg.Replace("Page:", "");
ShowPage(pageName);
}
else if (msg.StartsWith("Model:"))
{
string modelName = msg.Replace("Model:", "");
PlayModelAnimation(modelName);
}
else if (msg.StartsWith("Progress:"))
{
if (float.TryParse(msg.Replace("Progress:", ""), out float progress))
{
SetAnimationProgress(progress);
Debug.Log($"处理进度消息: Progress:{progress:F2}");
}
}
}
// 每帧发送动画进度到客户端
if (clientStream != null && clientStream.CanWrite)
{
if (pageModelCache.TryGetValue(currentPage, out PageModel pm) && pm != null && pm.model != null)
{
ModelController mc = pm.model.GetComponent<ModelController>();
if (mc != null)
{
float progress = mc.GetAnimationProgress();
try
{
string progressMsg = $"Progress:{progress:F2}";
byte[] data = Encoding.UTF8.GetBytes(progressMsg);
clientStream.Write(data, 0, data.Length);
Debug.Log($"发送动画进度: {progressMsg}");
}
catch (Exception ex)
{
Debug.LogError($"发送动画进度失败: {ex.Message}");
clientStream = null; // 标记流失效
}
}
}
}
}
// 切换激活的UI页面并更新模型
private void ShowPage(string pageName)
{
foreach (Transform child in background)
child.gameObject.SetActive(child.name == pageName);
{
child.gameObject.SetActive(child.name == pageName); // 仅激活目标页面
}
currentPage = pageName;
// 更新模型可见性并重置动画
foreach (var pageModel in pageModels)
{
if (pageModel.model != null)
@ -112,34 +197,60 @@ public class DisplayServer : MonoBehaviour
pageModel.model.SetActive(isActive);
ModelController mc = pageModel.model.GetComponent<ModelController>();
if (mc != null) mc.ResetAnimation();
if (mc != null)
{
mc.ResetAnimation();
Debug.Log($"模型 {pageModel.model.name} 重置,页面: {pageName}");
}
}
}
Debug.Log($"显示端切换到页面: {pageName}");
}
// 为指定模型播放动画
private void PlayModelAnimation(string modelName)
{
PageModel pm = pageModels.Find(p => p.model != null && p.model.name == modelName);
if (pm != null)
{
ModelController mc = pm.model.GetComponent<ModelController>();
if (mc != null) mc.PlayAnimation(); // 播放模型默认动画
if (mc != null)
{
mc.PlayAnimation();
Debug.Log($"播放模型动画: {modelName}");
}
}
}
// 设置当前页面模型的动画进度
private void SetAnimationProgress(float progress)
{
PageModel pm = pageModels.Find(p => p.pageName == currentPage);
if (pm != null && pm.model != null)
if (pageModelCache.TryGetValue(currentPage, out PageModel pm) && pm != null && pm.model != null)
{
ModelController mc = pm.model.GetComponent<ModelController>();
if (mc != null) mc.SetAnimationProgress(progress);
if (mc != null)
{
mc.SetAnimationProgress(progress);
Debug.Log($"设置模型 {pm.model.name} 进度: {progress:F2}");
}
}
else
{
Debug.LogWarning($"未找到页面 {currentPage} 的模型或ModelController");
}
}
// 应用程序退出时清理资源
private void OnApplicationQuit()
{
isRunning = false;
listenCts.Cancel();
listener.Stop();
clientStream?.Close();
if (listenThread != null && listenThread.IsAlive)
{
listenThread.Join(1000); // 等待线程结束
}
}
}
}

View File

@ -1,76 +1,150 @@
using UnityEngine;
using System.Collections.Generic;
public class ModelController : MonoBehaviour
{
private Animator animator;
private string currentAnim = "";
private bool isPlaying = false;
private Animator animator; // 控制动画的Animator组件
private string currentAnim = ""; // 跟踪当前播放的动画
private bool isPlaying = false; // 跟踪动画播放状态
[Header("ĬÈ϶¯»­×´Ì¬Ãû³Æ")]
public string defaultAnimName = "Idle";
public string defaultAnimName = "Idle"; // 默认动画状态名称
private Dictionary<string, int> stateHashes = new Dictionary<string, int>(); // 动画状态哈希缓存
// 脚本初始化时调用
void Awake()
{
animator = GetComponent<Animator>();
// 缓存默认动画状态的哈希值以提高性能
if (!string.IsNullOrEmpty(defaultAnimName))
{
stateHashes[defaultAnimName] = Animator.StringToHash(defaultAnimName);
}
}
// 在Update中更新动画状态
void Update()
{
if (isPlaying && animator != null && !string.IsNullOrEmpty(currentAnim))
{
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);
if (stateInfo.IsName(currentAnim) && stateInfo.normalizedTime >= 1f)
{
// 动画播放完成,暂停并标记
animator.enabled = false;
isPlaying = false;
Debug.Log($"动画 {currentAnim} 播放完成,暂停");
}
}
}
/// <summary>
/// 播放默认动画从0开始
/// 从头播放默认动画
/// </summary>
public void PlayAnimation()
{
if (animator == null || string.IsNullOrEmpty(defaultAnimName)) return;
if (!AnimatorHasState(defaultAnimName))
{
Debug.LogWarning($"Animator 上不存在状态: {defaultAnimName}");
Debug.LogWarning($"Animator上不存在状态: {defaultAnimName}");
return;
}
currentAnim = defaultAnimName;
animator.enabled = true;
animator.Play(currentAnim, 0, 0f);
animator.Update(0f);
isPlaying = true;
animator.Play(currentAnim, 0, 0f); // 从头播放动画
animator.Update(0f); // 强制立即更新
isPlaying = true; // 标记动画正在播放
Debug.Log($"开始播放动画: {currentAnim}");
}
/// <summary>
/// 设置动画进度 0~1
/// 设置动画进度0到1
/// </summary>
public void SetAnimationProgress(float normalizedTime)
{
if (animator == null || string.IsNullOrEmpty(currentAnim)) return;
if (animator == null || string.IsNullOrEmpty(defaultAnimName)) return;
if (!gameObject.activeSelf) return;
// 确保currentAnim已设置
if (string.IsNullOrEmpty(currentAnim))
{
currentAnim = defaultAnimName;
Debug.Log($"设置动画进度前初始化currentAnim: {currentAnim}");
}
if (!AnimatorHasState(currentAnim))
{
Debug.LogWarning($"Animator上不存在状态: {currentAnim}");
return;
}
animator.enabled = true;
animator.Play(currentAnim, 0, Mathf.Clamp01(normalizedTime));
animator.Update(0f);
animator.enabled = false;
isPlaying = false;
float clampedTime = Mathf.Clamp01(normalizedTime);
animator.Play(currentAnim, 0, clampedTime); // 设置动画到指定时间
animator.Update(0f); // 强制立即更新
animator.enabled = false; // 暂停动画
isPlaying = false; // 标记动画暂停
Debug.Log($"设置动画 {currentAnim} 进度: {clampedTime:F2}");
}
/// <summary>
/// 页面切换或复位时调用
/// 重置动画到初始状态
/// </summary>
public void ResetAnimation()
{
if (animator == null) return;
if (!gameObject.activeSelf) return;
string animToReset = !string.IsNullOrEmpty(defaultAnimName) ? defaultAnimName : "";
if (string.IsNullOrEmpty(animToReset)) return;
currentAnim = animToReset; // 确保currentAnim已设置
animator.enabled = true;
animator.Play(currentAnim != "" ? currentAnim : defaultAnimName, 0, 0f);
animator.Update(0f);
animator.enabled = false;
currentAnim = "";
isPlaying = false;
animator.Play(currentAnim, 0, 0f); // 重置到开始
animator.Update(0f); // 强制立即更新
animator.enabled = false; // 暂停动画
isPlaying = false; // 标记动画暂停
Debug.Log($"重置动画: {currentAnim}");
}
/// <summary>
/// 获取当前动画的标准化时间0到1
/// </summary>
/// <returns>当前动画进度若无动画则返回0</returns>
public float GetAnimationProgress()
{
if (animator == null || string.IsNullOrEmpty(currentAnim) || !gameObject.activeSelf)
{
return 0f;
}
if (!AnimatorHasState(currentAnim))
{
return 0f;
}
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);
if (stateInfo.IsName(currentAnim))
{
float progress = Mathf.Clamp01(stateInfo.normalizedTime % 1f);
Debug.Log($"获取动画 {currentAnim} 进度: {progress:F2}");
return progress;
}
return 0f;
}
// 检查指定的动画状态是否存在于Animator中
private bool AnimatorHasState(string stateName)
{
for (int i = 0; i < animator.layerCount; i++)
if (stateHashes.TryGetValue(stateName, out int hash))
{
if (animator.HasState(i, Animator.StringToHash(stateName)))
return true;
for (int i = 0; i < animator.layerCount; i++)
{
if (animator.HasState(i, hash)) return true;
}
}
return false;
}
}
}

View File

@ -1,112 +1,273 @@
using UnityEngine;
using UnityEngine.UI;
using System.Net.Sockets;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using UnityEngine;
using UnityEngine.UI;
public class TouchClient : MonoBehaviour
{
private TcpClient client;
private NetworkStream stream;
private bool isConnected = false;
private TcpClient client; // 用于与显示端通信的TCP客户端
private NetworkStream stream; // 用于发送/接收数据的流
private volatile bool isConnected = false; // 线程安全的连接状态标志
private UdpClient udpListener;
private Thread udpThread;
private UdpClient udpListener; // 用于接收广播IP的UDP客户端
private Thread udpThread; // 监听广播的线程
private CancellationTokenSource udpCts = new CancellationTokenSource(); // 控制UDP线程取消
public Transform background;
private string currentPage = "首页";
private Thread receiveThread; // 接收服务器消息的线程
private CancellationTokenSource receiveCts = new CancellationTokenSource(); // 控制接收线程取消
public Transform background; // UI页面的父级变换
private string currentPage = "首页"; // 跟踪当前显示的页面
private readonly Queue<float> progressQueue = new Queue<float>(); // 线程安全的进度队列
private readonly object queueLock = new object(); // 进度队列访问锁
private bool isDraggingSlider = false; // 标记是否正在拖动Slider
// 脚本启动时调用
void Start()
{
// 设置触摸控制端分辨率为 1920x1080
Screen.SetResolution(1920, 1080, false);
// 在端口9999上初始化UDP监听
udpListener = new UdpClient(9999);
udpThread = new Thread(ListenForBroadcast);
udpThread = new Thread(() => ListenForBroadcast(udpCts.Token));
udpThread.Start();
Debug.Log("触摸端等待显示端广播...");
// 显示初始页面
ShowPage("首页");
}
private void ListenForBroadcast()
// 监听UDP广播以发现显示端IP
private void ListenForBroadcast(CancellationToken token)
{
IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, 9999);
while (!isConnected)
// 在未连接或未取消的情况下持续监听
while (!isConnected && !token.IsCancellationRequested)
{
byte[] data = udpListener.Receive(ref endPoint);
string serverIp = Encoding.UTF8.GetString(data);
try
{
// 接收广播数据
byte[] data = udpListener.Receive(ref endPoint);
string serverIp = Encoding.UTF8.GetString(data);
Debug.Log("发现显示端IP: " + serverIp);
ConnectToServer(serverIp, 8888);
Debug.Log("发现显示端IP: " + serverIp);
ConnectToServer(serverIp, 8888); // 尝试连接到服务器
}
catch (Exception ex)
{
Debug.LogError($"UDP接收错误: {ex.Message}");
Thread.Sleep(1000); // 避免快速重试
}
}
}
// 通过TCP连接到显示端服务器
private void ConnectToServer(string ip, int port)
{
try
{
client = new TcpClient();
client.Connect(ip, port);
client.Connect(ip, port); // 连接到服务器
stream = client.GetStream();
isConnected = true;
udpCts.Cancel(); // 连接成功后停止UDP监听线程
udpListener?.Close(); // 关闭UDP监听器
Debug.Log("触摸端已连接到显示端: " + ip);
// 启动接收线程以处理服务器消息
receiveThread = new Thread(() => ReceiveMessages(receiveCts.Token));
receiveThread.Start();
}
catch
catch (Exception ex)
{
Debug.Log("连接显示端失败");
Debug.LogError($"连接显示端失败: {ex.Message}");
}
}
// 接收服务器发送的消息
private void ReceiveMessages(CancellationToken token)
{
byte[] message = new byte[4096];
int bytesRead;
while (!token.IsCancellationRequested && isConnected)
{
try
{
bytesRead = stream.Read(message, 0, 4096);
if (bytesRead == 0) break; // 服务器断开连接
string data = Encoding.UTF8.GetString(message, 0, bytesRead);
if (data.StartsWith("Progress:") && float.TryParse(data.Replace("Progress:", ""), out float progress))
{
lock (queueLock)
{
progressQueue.Clear(); // 清空队列以确保最新进度
progressQueue.Enqueue(progress); // 将进度加入队列
Debug.Log($"收到进度: {progress:F2}");
}
}
}
catch (Exception ex)
{
Debug.LogError($"接收服务器消息错误: {ex.Message}");
isConnected = false;
break;
}
}
}
// 向显示端服务器发送消息
private void SendMessageToServer(string msg)
{
if (isConnected && stream != null)
{
byte[] data = Encoding.UTF8.GetBytes(msg);
stream.Write(data, 0, data.Length);
Debug.Log("发送指令: " + msg);
try
{
byte[] data = Encoding.UTF8.GetBytes(msg);
stream.Write(data, 0, data.Length);
Debug.Log("发送指令: " + msg);
}
catch (Exception ex)
{
Debug.LogError($"发送消息失败: {ex.Message}");
isConnected = false; // 标记连接失效
}
}
}
// 页面按钮点击时调用
public void OnButtonClick_Page(string pageName)
{
ShowPage(pageName);
SendMessageToServer("Page:" + pageName);
ShowPage(pageName); // 切换到指定页面
SendMessageToServer("Page:" + pageName); // 通知服务器
}
// 模型播放按钮点击时调用
public void OnButtonClick_PlayModel(string modelName)
{
SendMessageToServer("Model:" + modelName);
SendMessageToServer("Model:" + modelName); // 通知服务器播放模型
}
public void OnButtonClick_Anim(string animName)
{
SendMessageToServer("Anim:" + animName);
}
// Slider 绑定的方法
// 滑块值改变时调用
public void OnSliderChanged(Slider slider)
{
float progress = slider.value; // 0-100
SendMessageToServer("Progress:" + progress.ToString("F2"));
isDraggingSlider = true; // 标记正在拖动
float progress = slider.value / 100f; // 转换为0-1
SendMessageToServer("Progress:" + progress.ToString("F2")); // 发送进度
Debug.Log($"Slider拖动到: {progress:F2}");
}
// 滑块拖动结束时调用需在Inspector中绑定
public void OnSliderEndDrag()
{
isDraggingSlider = false; // 结束拖动
Debug.Log("Slider拖动结束");
}
// 获取当前页面的Slider组件
private Slider GetCurrentPageSlider()
{
if (background == null || currentPage == "首页") return null;
Transform pageTransform = background.Find(currentPage);
if (pageTransform != null)
{
Slider slider = pageTransform.GetComponentInChildren<Slider>();
if (slider != null)
{
if (!slider.interactable)
{
slider.interactable = true; // 确保Slider可交互
Debug.Log($"启用Slider交互: {currentPage}");
}
return slider;
}
Debug.LogWarning($"未在页面 {currentPage} 找到Slider");
return null;
}
Debug.LogWarning($"未找到页面 {currentPage}");
return null;
}
// 切换激活的UI页面
private void ShowPage(string pageName)
{
foreach (Transform child in background)
{
child.gameObject.SetActive(child.name == pageName);
child.gameObject.SetActive(child.name == pageName); // 仅激活目标页面
}
currentPage = pageName;
Debug.Log($"切换到页面:{pageName}");
// 清空进度队列以避免旧页面数据干扰
lock (queueLock)
{
progressQueue.Clear();
}
// 初始化当前页面的Slider
Slider slider = GetCurrentPageSlider();
if (slider != null)
{
slider.value = 0f; // 重置Slider到0
slider.interactable = true; // 确保可交互
// 绑定OnValueChanged事件
slider.onValueChanged.RemoveAllListeners();
slider.onValueChanged.AddListener((value) => OnSliderChanged(slider));
Debug.Log($"初始化Slider: {pageName}, 值: {slider.value}");
}
Debug.Log($"切换到页面: {pageName}, Slider {(slider != null ? "" : "")}");
}
// 在主线程中更新Slider进度
private void Update()
{
if (isDraggingSlider) return; // 拖动时忽略服务器进度
float progress = 0f;
lock (queueLock)
{
if (progressQueue.Count > 0)
{
progress = progressQueue.Dequeue(); // 获取最新进度
}
}
if (progress >= 0f)
{
Slider slider = GetCurrentPageSlider();
if (slider != null)
{
slider.value = progress * 100f; // 更新Slider值0-100
Debug.Log($"更新Slider进度: {progress:F2}, Slider值: {slider.value}");
}
}
}
// 应用程序退出时清理资源
private void OnApplicationQuit()
{
udpListener?.Close();
stream?.Close();
client?.Close();
udpCts.Cancel(); // 通知UDP线程停止
receiveCts.Cancel(); // 通知接收线程停止
if (udpThread != null && udpThread.IsAlive)
{
udpThread.Join(1000); // 等待UDP线程结束
}
if (receiveThread != null && receiveThread.IsAlive)
{
receiveThread.Join(1000); // 等待接收线程结束
}
udpListener?.Close(); // 关闭UDP监听器
stream?.Close(); // 关闭TCP流
client?.Close(); // 关闭TCP客户端
}
}
}

View File

@ -11,7 +11,7 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 3642894306514449799}
m_Position: {x: 200, y: 0, z: 0}
m_Position: {x: 280, y: 70, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []

View File

@ -5,10 +5,10 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
- enabled: 0
path: Assets/Scenes/DisplayScene.unity
guid: 9fc0d4010bbf28b4594072e72b8655ab
- enabled: 0
- enabled: 1
path: Assets/Scenes/ControlScene.unity
guid: 02ef5fc1c6d30b4418b28a537c837315
m_configObjects: {}

View File

@ -6,13 +6,16 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedSceneGuid-0:
value: 5303510050530a0a0e58087140210b44474f1a78742973637a2a4560b5b3656d
value: 5b08575357065d085f0c587114725c44154e4e2e297f72347a7c4e31e4b66661
flags: 0
RecentlyUsedSceneGuid-1:
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
value: 54035756510d5a0c095f0d7414760b4446154b782e7b7063752a1b62e7b5363b
flags: 0
RecentlyUsedSceneGuid-2:
value: 5b08575357065d085f0c587114725c44154e4e2e297f72347a7c4e31e4b66661
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
flags: 0
RecentlyUsedSceneGuid-3:
value: 5303510050530a0a0e58087140210b44474f1a78742973637a2a4560b5b3656d
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650

View File

@ -19,7 +19,7 @@ MonoBehaviour:
width: 1536
height: 772.8
m_ShowMode: 4
m_Title: Project
m_Title: Scene
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
@ -99,7 +99,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 52
controlID: 58
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
@ -131,23 +131,25 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: GameView
m_Name: SceneView
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 854.4
width: 890.4
height: 722.8
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 13}
- {fileID: 15}
m_Selected: 1
m_LastSelected: 0
- {fileID: 17}
- {fileID: 12}
- {fileID: 11}
m_Selected: 0
m_LastSelected: 1
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@ -165,14 +167,14 @@ MonoBehaviour:
- {fileID: 10}
m_Position:
serializedVersion: 2
x: 854.4
x: 890.4
y: 0
width: 327.19995
width: 242.40002
height: 722.8
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 58
controlID: 31
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@ -183,20 +185,20 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_Name: InspectorWindow
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 1181.6
x: 1132.8
y: 0
width: 354.40002
width: 403.19995
height: 722.8
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 11}
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 13}
m_Panes:
- {fileID: 11}
- {fileID: 13}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &9
@ -216,13 +218,13 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 327.19995
height: 318.4
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 14}
width: 242.40002
height: 538.4
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 14}
- {fileID: 16}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &10
@ -235,23 +237,188 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_Name: ProjectBrowser
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 318.4
width: 327.19995
height: 404.4
y: 538.4
width: 242.40002
height: 184.39996
m_MinSize: {x: 232, y: 271}
m_MaxSize: {x: 10002, y: 10021}
m_ActualView: {fileID: 12}
m_ActualView: {fileID: 14}
m_Panes:
- {fileID: 12}
- {fileID: 14}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12071, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Animation
m_Image: {fileID: -3237396543322336831, guid: 0000000000000000d000000000000000, type: 0}
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 0
y: 73.6
width: 959
height: 701.8
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
m_SaveData: []
m_OverlaysVisible: 1
m_LockTracker:
m_IsLocked: 0
m_LastSelectedObjectID: 1946270
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12914, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Animator
m_Image: {fileID: 1711060831702674872, guid: 0000000000000000d000000000000000, type: 0}
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 0
y: 73.6
width: 1186.2
height: 989.80005
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
m_SaveData: []
m_OverlaysVisible: 1
m_ViewTransforms:
m_KeySerializationHelper:
- {fileID: 7740452523822912909, guid: d309f9bd8867c9e4bbc65de948c10ba0, type: 2}
- {fileID: 9160858644863225337, guid: d24fb50d1b81f3d4fb77b59f298c6391, type: 2}
- {fileID: -5493858010228640296, guid: da2d18bdd63eddf4db4344988663132b, type: 2}
- {fileID: -5073058742846949024, guid: 9a5ed5f9dc25f9b498cfc53347cb4567, type: 2}
- {fileID: -2230655706508628860, guid: c06c13b013fc9334096e1edcfb15e759, type: 2}
m_ValueSerializationHelper:
- e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
- e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
- e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
- e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
- e00: 0.81218034
e01: 0
e02: 0
e03: 88.79291
e10: 0
e11: 0.81218034
e12: 0
e13: 49.59546
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_PreviewAnimator: {fileID: 0}
m_AnimatorController: {fileID: 9100000, guid: da2d18bdd63eddf4db4344988663132b, type: 2}
m_BreadCrumbs:
- m_Target: {fileID: -5493858010228640296, guid: da2d18bdd63eddf4db4344988663132b, type: 2}
m_ScrollPosition: {x: 0, y: 0}
stateMachineGraph: {fileID: 0}
stateMachineGraphGUI: {fileID: 0}
blendTreeGraph: {fileID: 0}
blendTreeGraphGUI: {fileID: 0}
m_AutoLiveLink: 1
m_MiniTool: 0
m_LockTracker:
m_IsLocked: 0
m_CurrentEditor: 0
m_LayerEditor:
m_SelectedLayerIndex: 0
--- !u!114 &13
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
@ -271,9 +438,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1181.6
x: 1132.8
y: 73.6
width: 353.40002
width: 402.19995
height: 701.8
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -293,7 +460,7 @@ MonoBehaviour:
m_LockTracker:
m_IsLocked: 0
m_PreviewWindow: {fileID: 0}
--- !u!114 &12
--- !u!114 &14
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
@ -313,10 +480,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 854.4
y: 392
width: 325.19995
height: 383.4
x: 890.4
y: 612
width: 240.40002
height: 163.39996
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -333,7 +500,7 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Scripts
- Assets/Scenes
m_Globs: []
m_OriginalText:
m_FilterByTypeIntersection: 0
@ -348,7 +515,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 7c780000
m_LastClickedID: 30844
m_ExpandedIDs: 00000000da460100dc460100de460100e0460100e2460100e4460100
m_ExpandedIDs: 0000000024ac010026ac010028ac01002aac01002cac01002eac010030ac0100
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -373,10 +540,10 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_AssetTreeState:
scrollPos: {x: 0, y: 58.600006}
scrollPos: {x: 0, y: 300}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: ffffffff00000000da460100dc460100de460100e0460100e2460100e4460100
m_ExpandedIDs: ffffffff0000000024ac010026ac010028ac01002aac01002cac01002eac010030ac0100
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -432,7 +599,7 @@ MonoBehaviour:
m_GridSize: 64
m_SkipHiddenPackages: 0
m_DirectoriesAreaWidth: 115
--- !u!114 &13
--- !u!114 &15
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
@ -454,7 +621,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73.6
width: 853.4
width: 889.4
height: 701.8
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -465,8 +632,8 @@ MonoBehaviour:
floating: 0
collapsed: 0
displayed: 1
snapOffset: {x: -100, y: -25.599976}
snapOffsetDelta: {x: 0, y: 0}
snapOffset: {x: -100, y: -25.600006}
snapOffsetDelta: {x: 0, y: 0.000030517578}
snapCorner: 3
id: Tool Settings
index: 0
@ -476,9 +643,9 @@ MonoBehaviour:
floating: 0
collapsed: 0
displayed: 1
snapOffset: {x: -141, y: 149}
snapOffset: {x: -141, y: -199.79999}
snapOffsetDelta: {x: 0, y: 0}
snapCorner: 1
snapCorner: 3
id: unity-grid-and-snap-toolbar
index: 1
layout: 1
@ -702,9 +869,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -32.778976, y: -9.8186455, z: 49.312233}
m_Target: {x: 1664, y: 676, z: 0}
speed: 2
m_Value: {x: -32.778976, y: -9.8186455, z: 49.312233}
m_Value: {x: 1663.9999, y: 675.99994, z: 0.0000059604645}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -751,20 +918,20 @@ MonoBehaviour:
m_GridAxis: 1
m_gridOpacity: 0.5
m_Rotation:
m_Target: {x: 0.33473206, y: 0.41149613, z: -0.16586047, w: 0.8314923}
m_Target: {x: 0.0725394, y: -0.011645896, z: 0.00085166015, w: 0.99730253}
speed: 2
m_Value: {x: 0.33468792, y: 0.4114419, z: -0.16583861, w: 0.8313827}
m_Value: {x: -0.072539404, y: 0.011645896, z: -0.00085166015, w: -0.99730253}
m_Size:
m_Target: 65.2069
m_Target: 1564.3491
speed: 2
m_Value: 65.2069
m_Value: 1638.0619
m_Ortho:
m_Target: 1
m_Target: 0
speed: 2
m_Value: 1
m_Value: 0
m_CameraSettings:
m_Speed: 0.8259
m_SpeedNormalized: 0.41
m_Speed: 0.7662
m_SpeedNormalized: 0.38
m_SpeedMin: 0.01
m_SpeedMax: 2
m_EasingEnabled: 1
@ -775,14 +942,14 @@ MonoBehaviour:
m_FarClip: 10000
m_DynamicClip: 1
m_OcclusionCulling: 0
m_LastSceneViewRotation: {x: -0.015598819, y: -0.0035844787, z: -0.00010052163, w: 0.99997914}
m_LastSceneViewOrtho: 1
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_LastSceneViewOrtho: 0
m_ReplacementShader: {fileID: 0}
m_ReplacementString:
m_SceneVisActive: 1
m_LastLockedObject: {fileID: 0}
m_ViewIsLockedToObject: 0
--- !u!114 &14
--- !u!114 &16
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
@ -802,10 +969,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 854.4
x: 890.4
y: 73.6
width: 325.19995
height: 297.4
width: 240.40002
height: 517.4
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -814,9 +981,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: ae490000
m_LastClickedID: 0
m_ExpandedIDs: 34fbfffff257000024580000
m_SelectedIDs: 9eb00100
m_LastClickedID: 110750
m_ExpandedIDs: 8e3affff08fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -840,7 +1007,7 @@ MonoBehaviour:
m_IsLocked: 0
m_CurrentSortingName: TransformSorting
m_WindowGUID: 733c28ef5d2030949b73c3d6246d5565
--- !u!114 &15
--- !u!114 &17
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
@ -862,7 +1029,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73.6
width: 853.4
width: 889.4
height: 701.8
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -913,10 +1080,10 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 853.4
width: 889.4
height: 680.8
m_Scale: {x: 0.32053787, y: 0.32053787}
m_Translation: {x: 426.70004, y: 340.4}
m_Scale: {x: 0.33405948, y: 0.33405948}
m_Translation: {x: 444.7, y: 340.4}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
@ -924,12 +1091,12 @@ MonoBehaviour:
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -1331.2001
y: -1061.965
y: -1018.9802
width: 2662.4001
height: 2123.93
height: 2037.9604
m_MinimalGUI: 1
m_defaultScale: 0.32053787
m_LastWindowPixelSize: {x: 1066.75, y: 877.25}
m_defaultScale: 0.33405948
m_LastWindowPixelSize: {x: 1111.75, y: 877.25}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 00000000000000000000