Skip to content

Commit dd5e837

Browse files
author
yinlong
committed
fix 非WebGL平台打包兼容BUG
1 parent 2c86c50 commit dd5e837

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Example/Example.unity

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
41+
m_IndirectSpecularColor: {r: 0.37311947, g: 0.38074005, b: 0.35872722, a: 1}
4242
--- !u!157 &3
4343
LightmapSettings:
4444
m_ObjectHideFlags: 0
@@ -362,7 +362,7 @@ RectTransform:
362362
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
363363
m_AnchorMin: {x: 0, y: 1}
364364
m_AnchorMax: {x: 1, y: 1}
365-
m_AnchoredPosition: {x: -0.0000019468666, y: -0.00002671818}
365+
m_AnchoredPosition: {x: 0.000021455015, y: -0.0000042927095}
366366
m_SizeDelta: {x: 0, y: 0}
367367
m_Pivot: {x: 0, y: 1}
368368
--- !u!114 &208146964
@@ -1508,7 +1508,7 @@ RectTransform:
15081508
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
15091509
m_AnchorMin: {x: 0, y: 0}
15101510
m_AnchorMax: {x: 1, y: 0}
1511-
m_AnchoredPosition: {x: 0, y: 0}
1511+
m_AnchoredPosition: {x: 0, y: -0.00001220189}
15121512
m_SizeDelta: {x: 0, y: 0}
15131513
m_Pivot: {x: 0, y: 0}
15141514
--- !u!114 &753216757
@@ -1712,7 +1712,7 @@ RectTransform:
17121712
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17131713
m_AnchorMin: {x: 0, y: 1}
17141714
m_AnchorMax: {x: 1, y: 1}
1715-
m_AnchoredPosition: {x: -10.58, y: -70.9}
1715+
m_AnchoredPosition: {x: -10.58, y: -71}
17161716
m_SizeDelta: {x: -21.16, y: 35.62}
17171717
m_Pivot: {x: 0.5, y: 0.5}
17181718
--- !u!1 &821358077
@@ -2939,7 +2939,7 @@ MonoBehaviour:
29392939
m_HandleRect: {fileID: 114770475}
29402940
m_Direction: 2
29412941
m_Value: 0
2942-
m_Size: 1
2942+
m_Size: 0.9999998
29432943
m_NumberOfSteps: 0
29442944
m_OnValueChanged:
29452945
m_PersistentCalls:
@@ -3717,7 +3717,7 @@ MonoBehaviour:
37173717
m_TargetGraphic: {fileID: 837294422}
37183718
m_HandleRect: {fileID: 837294421}
37193719
m_Direction: 2
3720-
m_Value: 1
3720+
m_Value: 0
37213721
m_Size: 1
37223722
m_NumberOfSteps: 0
37233723
m_OnValueChanged:

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Example/TestWebSocket.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public void NewSocket()
5656
entryItem.transform.localScale = Vector3.one;
5757
entryItem.transform.localRotation = Quaternion.identity;
5858
entryItem.onClick.AddListener(() => { OnEntryItemClick(entry); });
59+
60+
if (m_selectedEntry == null)
61+
m_selectedEntry = entry;
5962
}
6063

6164
private void OnEntryItemClick(WebSocketEntry entry)

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/websocket-jslib/WebSocket.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
#if UNITY_WEBGL && !UNITY_EDITOR
12
using System.Runtime.InteropServices;
23
using System;
34
using UnityWebSocket;
45

6+
57
namespace WebSocketJslib
68
{
79
/// <summary>
@@ -94,4 +96,5 @@ private void OnError(string msg)
9496
onError(this, new ErrorEventArgs(msg));
9597
}
9698
}
97-
}
99+
}
100+
#endif

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/websocket-jslib/WebSocketReceiver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if UNITY_WEBGL && !UNITY_EDITOR
12
using System;
23
using System.Collections.Generic;
34
using System.Linq;
@@ -200,3 +201,4 @@ public void HandleError(string message)
200201
}
201202
}
202203
}
204+
#endif

UnityWebSocket/ProjectSettings/GraphicsSettings.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GraphicsSettings:
3737
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
3838
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
3939
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
40+
- {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
4041
m_PreloadedShaders: []
4142
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
4243
type: 0}

UnityWebSocket/ProjectSettings/ProjectSettings.asset

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PlayerSettings:
1111
targetDevice: 2
1212
useOnDemandResources: 0
1313
accelerometerFrequency: 60
14-
companyName: DefaultCompany
14+
companyName: com.redstone
1515
productName: UnityWebsocket
1616
defaultCursor: {fileID: 0}
1717
cursorHotspot: {x: 0, y: 0}
@@ -157,7 +157,8 @@ PlayerSettings:
157157
resolutionScalingMode: 0
158158
androidSupportedAspectRatio: 1
159159
androidMaxAspectRatio: 2.1
160-
applicationIdentifier: {}
160+
applicationIdentifier:
161+
Android: com.redstone.UnityWebsocket
161162
buildNumber: {}
162163
AndroidBundleVersionCode: 1
163164
AndroidMinSdkVersion: 16

0 commit comments

Comments
 (0)