设备连接界面完善

This commit is contained in:
lishuo 2021-08-31 16:27:36 +08:00
parent 3a360d3437
commit cdccd78602
11 changed files with 1754 additions and 517 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4a45086f0adfd5a4a9c2a60543866ea4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: b506553c2e5ef6141975163f7c2fdffc
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: a38e5e467140caa4d9bd38fd08291bf7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: 79e2c0a32a9a14b47a41c3bd71e356bd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -201,8 +201,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 136, y: -72}
m_SizeDelta: {x: 160, y: 30}
m_AnchoredPosition: {x: 20, y: -110}
m_SizeDelta: {x: 64, y: 14}
m_Pivot: {x: 0, y: 1}
--- !u!222 &740803332586528087
CanvasRenderer:
@ -233,15 +233,15 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 1db9e217733971041be26b076fda6083, type: 3}
m_FontSize: 14
m_FontSize: 12
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: NO DEVICE
@ -353,8 +353,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 136, y: -39}
m_SizeDelta: {x: 160, y: 30}
m_AnchoredPosition: {x: 20, y: -88}
m_SizeDelta: {x: 137, y: 18}
m_Pivot: {x: 0, y: 1}
--- !u!222 &3255011571667659685
CanvasRenderer:
@ -385,7 +385,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197, type: 3}
m_FontSize: 20
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@ -393,7 +393,7 @@ MonoBehaviour:
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Smart Trainer
@ -1028,8 +1028,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 30, y: -30}
m_SizeDelta: {x: 96, y: 94}
m_AnchoredPosition: {x: 20, y: -20}
m_SizeDelta: {x: 48, y: 48}
m_Pivot: {x: 0, y: 1}
--- !u!222 &5081673493780997499
CanvasRenderer:
@ -1111,7 +1111,7 @@ RectTransform:
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: 710, y: 542}
m_SizeDelta: {x: 724, y: 250}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8841728471644699098
MonoBehaviour:
@ -1318,10 +1318,10 @@ RectTransform:
m_Father: {fileID: 8260988677505792498}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 20, y: -154}
m_SizeDelta: {x: -40, y: -242}
m_AnchoredPosition: {x: -547, y: -20}
m_SizeDelta: {x: 527, y: 210}
m_Pivot: {x: 0, y: 1}
--- !u!222 &4764678040190303057
CanvasRenderer:
@ -1390,12 +1390,12 @@ PrefabInstance:
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1405,12 +1405,12 @@ PrefabInstance:
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_SizeDelta.x
value: -571.4
value: 137
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1455,12 +1455,12 @@ PrefabInstance:
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -206.4
value: 157
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 30
value: -230
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1505,7 +1505,7 @@ PrefabInstance:
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 20
objectReference: {fileID: 0}
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1550,12 +1550,12 @@ PrefabInstance:
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1565,12 +1565,12 @@ PrefabInstance:
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_SizeDelta.x
value: -581.5
value: 137
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1615,12 +1615,12 @@ PrefabInstance:
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -376.5
value: 157
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 30
value: -178
objectReference: {fileID: 0}
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
@ -1665,7 +1665,7 @@ PrefabInstance:
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 20
objectReference: {fileID: 0}
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
type: 3}

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@ namespace Assets.Scripts.Devices
private List<DeviceAdapter> adapters = new List<DeviceAdapter>();
public MainDeviceAdapter()
{
#if UNITY_IOS || UNITY_TVOS || UNITY_ANDROID
#if UNITY_IOS || UNITY_ANDROID
this.CreateBleAdapter();
#else
this.CreateBleAdapter();
@ -30,7 +30,7 @@ namespace Assets.Scripts.Devices
private void CreateBleAdapter()
{
#if UNITY_IOS || UNITY_TVOS || UNITY_ANDROID
#if UNITY_IOS || UNITY_ANDROID
adapters.Add(new BleDeviceAdapter(BleMobileInterface.GetInterface()));
#else
adapters.Add(new BleDeviceAdapter(BleWinHwInterface.GetInterface()));

View File

@ -125,7 +125,12 @@ public class DeviceView : MonoBehaviour
{
if (deviceModal == null)
{
#if UNITY_IOS || UNITY_ANDROID
var obj = Resources.Load("UI/Prefab/Device/Mobile/ConnectDeviceModal");
#else
var obj = Resources.Load("UI/Prefab/Device/ConnectDeviceModal");
#endif
GameObject gameObject = (GameObject)Instantiate(obj);
deviceModal = gameObject.GetComponent<ConnectDeviceModal>();
}
@ -140,7 +145,11 @@ public class DeviceView : MonoBehaviour
// device.Disconnect();
//}
#if UNITY_IOS || UNITY_ANDROID
var obj = Resources.Load("UI/Prefab/Device/Mobile/ConnectDeviceModal");
#else
var obj = Resources.Load("UI/Prefab/Device/ConnectDeviceModal");
#endif
GameObject gameObject = (GameObject)Instantiate(obj);
deviceModal = gameObject.GetComponent<ConnectDeviceModal>();
deviceModal.SensorType = this.SensorType;
@ -234,13 +243,18 @@ public class DeviceView : MonoBehaviour
{
mSearchButton.SetActive(false);
mPairButton.SetActive(true);
#if UNITY_IOS || UNITY_ANDROID
searchState.gameObject.SetActive(false);
#endif
logo.sprite = sprite1;
//App.MainDeviceAdapter.GetDevices().First(d => d.Sensor == SensorType).Connect();
}
else
{
#if !(UNITY_IOS || UNITY_ANDROID)
mSearchButton.SetActive(true);
#endif
mPairButton.SetActive(false);
}
}