From ee323f82e94d68fafd9909e5b97a36bfb800b4fb Mon Sep 17 00:00:00 2001 From: terric Date: Tue, 28 Nov 2023 02:00:13 +0800 Subject: [PATCH] bugfix & content update --- Assets/Plugins/Android/USBCamUtil.java | 77 ++++ Assets/Plugins/Android/USBCamUtil.java.meta | 32 ++ Assets/Resources/Animation/idle.anim | 2 +- Assets/Resources/UI/ActionListUI.prefab | 130 +++++- Assets/Resources/UI/FaceDetectUI.prefab | 132 +++++-- Assets/Resources/UI/MainUI.prefab | 372 +++++++++++++++++- Assets/Resources/UI/SplashUI.prefab | 137 ++++++- Assets/Scenes/Boot.unity | 177 ++++----- Assets/Scenes/FaceDetect.unity | 2 +- Assets/Scripts/Boot.cs | 2 - .../PoseCheck/EstimateModel/CVEstimator.cs | 12 +- Assets/Scripts/PoseCheck/HeadTurnDown.cs | 2 +- Assets/Scripts/PoseCheck/HeadTurnUp.cs | 2 +- Assets/Scripts/PoseCheck/HoldPosition.cs | 38 +- Assets/Scripts/PoseCheck/PoseBase.cs | 14 +- Assets/Scripts/Service/YogaManager.cs | 3 +- Assets/Scripts/Test/TestGuideUI.cs | 9 +- .../UI/Component/CaptureManagerBase.cs | 66 ++-- .../UI/Component/GudieAnimationManager.cs | 86 +++- .../MotionUSBCameraCaptureManager.cs | 16 +- .../Scripts/UI/Component/PanelItemManager.cs | 18 + Assets/Scripts/UI/FaceDetectUI.cs | 14 + Assets/Scripts/UI/GuideUI.cs | 18 +- Assets/Scripts/YogaDataLoader.cs | 17 +- Assets/UI/Img/background_title.png | Bin 0 -> 4355 bytes Assets/UI/Img/background_title.png.meta | 124 ++++++ Assets/UI/Img/healthCard.png | Bin 0 -> 829 bytes Assets/UI/Img/healthCard.png.meta | 124 ++++++ Assets/UI/Img/healthCardShadow.png | Bin 0 -> 3929 bytes Assets/UI/Img/healthCardShadow.png.meta | 124 ++++++ .../Scripts/UVCManager.cs | 23 +- Packages/manifest.json | 1 - Packages/packages-lock.json | 9 - 33 files changed, 1519 insertions(+), 264 deletions(-) create mode 100644 Assets/Plugins/Android/USBCamUtil.java create mode 100644 Assets/Plugins/Android/USBCamUtil.java.meta create mode 100644 Assets/UI/Img/background_title.png create mode 100644 Assets/UI/Img/background_title.png.meta create mode 100644 Assets/UI/Img/healthCard.png create mode 100644 Assets/UI/Img/healthCard.png.meta create mode 100644 Assets/UI/Img/healthCardShadow.png create mode 100644 Assets/UI/Img/healthCardShadow.png.meta diff --git a/Assets/Plugins/Android/USBCamUtil.java b/Assets/Plugins/Android/USBCamUtil.java new file mode 100644 index 0000000..db04278 --- /dev/null +++ b/Assets/Plugins/Android/USBCamUtil.java @@ -0,0 +1,77 @@ +package com.unity3d.player; + +import android.content.Context; +import android.hardware.usb.UsbDevice; +import android.hardware.usb.UsbManager; +import android.util.Log; + +import java.util.HashMap; +import java.util.Iterator; + +public class USBCamUtil { + static String RGBCamDeviceName = ""; + static String TargetCamName0 = "WN-Camera-RGB"; + static String TargetCamName1 = "RGB Camera"; + + static String IRCamDeviceName = ""; + static String TargetCamName2 = "WN-Camera-IR"; + static String TargetCamName3 = "IR Camera"; + + public static boolean CamIsRGB(String deviceName) + { + if(RGBCamDeviceName.isEmpty()) + { + UsbManager usbManager = (UsbManager)UnityPlayer.currentActivity.getSystemService(Context.USB_SERVICE); + HashMap deviceList = usbManager.getDeviceList(); + Log.d("USBCamUtil", "device count: "+deviceList.size()); + Iterator deviceIterator = deviceList.values().iterator(); + while (deviceIterator.hasNext()) { + UsbDevice device = deviceIterator.next(); + if(device.getProductName().equalsIgnoreCase(TargetCamName0) || device.getProductName().equalsIgnoreCase(TargetCamName1)) + { + RGBCamDeviceName = device.getDeviceName(); + } + Log.d("USBCamUtil", "ProductName: " + device.getProductName()+"-DeviceName:"+device.getDeviceName()); + } + } + return (deviceName.equalsIgnoreCase(RGBCamDeviceName)); + + } + + public static boolean CamIsIR(String deviceName) + { + if(IRCamDeviceName.isEmpty()) + { + UsbManager usbManager = (UsbManager)UnityPlayer.currentActivity.getSystemService(Context.USB_SERVICE); + HashMap deviceList = usbManager.getDeviceList(); + Log.d("USBCamUtil", "device count: "+deviceList.size()); + Iterator deviceIterator = deviceList.values().iterator(); + while (deviceIterator.hasNext()) { + UsbDevice device = deviceIterator.next(); + if(device.getProductName().equalsIgnoreCase(TargetCamName2) || device.getProductName().equalsIgnoreCase(TargetCamName3)) + { + IRCamDeviceName = device.getDeviceName(); + } + } + } + return (deviceName.equalsIgnoreCase(IRCamDeviceName)); + } + + public static String[] GetAllDevice() + { + UsbManager usbManager = (UsbManager)UnityPlayer.currentActivity.getSystemService(Context.USB_SERVICE); + HashMap deviceList = usbManager.getDeviceList(); + String[] sts = new String[deviceList.size()]; + + int index = 0; + Iterator deviceIterator = deviceList.values().iterator(); + while (deviceIterator.hasNext()) { + UsbDevice device = deviceIterator.next(); + + sts[index] = ("deviceName:"+device.getDeviceName()+" productname:"+device.getProductName()); + index++; + Log.d("USBCamUtil", "ProductName: " + device.getProductName()+"-DeviceName:"+device.getDeviceName()); + } + return sts; + } +} diff --git a/Assets/Plugins/Android/USBCamUtil.java.meta b/Assets/Plugins/Android/USBCamUtil.java.meta new file mode 100644 index 0000000..ebe262a --- /dev/null +++ b/Assets/Plugins/Android/USBCamUtil.java.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 08d3bbaae1b2e1441932dfb499ad49dd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Animation/idle.anim b/Assets/Resources/Animation/idle.anim index 40d2715..7ad784e 100644 --- a/Assets/Resources/Animation/idle.anim +++ b/Assets/Resources/Animation/idle.anim @@ -6618,7 +6618,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Resources/UI/ActionListUI.prefab b/Assets/Resources/UI/ActionListUI.prefab index 388c06a..fd531a8 100644 --- a/Assets/Resources/UI/ActionListUI.prefab +++ b/Assets/Resources/UI/ActionListUI.prefab @@ -624,8 +624,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: backgroundImage: {fileID: 21300000, guid: 8a37bc349b0192441bdbd6e9b7ccd808, type: 3} - buttonTitle: Shake head - buttonDescription: Nodding to relieve neck pressure + buttonTitle: Sternocleidomastoid muscle + buttonDescription: The sternocleidomastoid muscle is crucial for maintaining good + head and neck posture and stable cervical spine useCustomResources: 0 enableStatus: 1 statusItem: 0 @@ -1578,8 +1579,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 125, y: 0} - m_SizeDelta: {x: 200, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3299300514319254663 CanvasRenderer: @@ -3859,8 +3860,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: backgroundImage: {fileID: 21300000, guid: 599a6f48f62a43049a3b196a4b888d5a, type: 3} - buttonTitle: Nod - buttonDescription: Shaking head to relieve neck pressure + buttonTitle: Splenius & Rectus capitis anterior + buttonDescription: Exercise of Splenius & Rectus capitis anterior. Aim to relieve + Splenius & Rectus capitis anterior muscle tension useCustomResources: 0 enableStatus: 1 statusItem: 0 @@ -3996,8 +3998,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 125, y: 0} - m_SizeDelta: {x: 200, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1105460671971188788 CanvasRenderer: @@ -7788,6 +7790,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 4718637843428890479} - {fileID: 592144192930351671} - {fileID: 7572955664812918570} - {fileID: 3228235001121865301} @@ -8956,8 +8959,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: backgroundImage: {fileID: 21300000, guid: 59b9c7e480fc7b747826d40a7b03720c, type: 3} - buttonTitle: Stretching shoulder - buttonDescription: Stretching to relieve back pressure + buttonTitle: Scalene muscle + buttonDescription: Exercise of Scalene muscle. Relieve the press of that. Also + help to protect vein and artery under it. useCustomResources: 0 enableStatus: 1 statusItem: 0 @@ -9885,7 +9889,7 @@ MonoBehaviour: m_EditorClassIdentifier: backgroundImage: {fileID: 21300000, guid: c915009cb3f74e9419f24d0ccdde6b95, type: 3} buttonTitle: Health Detect - buttonDescription: Detect your Healthy State + buttonDescription: Detect your State useCustomResources: 0 enableStatus: 1 statusItem: 1 @@ -11666,7 +11670,7 @@ MonoBehaviour: m_EditorClassIdentifier: backgroundImage: {fileID: 21300000, guid: 71b8f375fd283b94db81f0ce51704ac0, type: 3} buttonTitle: Consulting - buttonDescription: DESCRIPTION + buttonDescription: Your private doctor useCustomResources: 0 enableStatus: 1 statusItem: 1 @@ -14476,3 +14480,105 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!1001 &4272169378470169863 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 6472390402513143558} + m_Modifications: + - target: {fileID: 4327728351019041244, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_Name + value: Background + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} +--- !u!224 &4718637843428890479 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + m_PrefabInstance: {fileID: 4272169378470169863} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Resources/UI/FaceDetectUI.prefab b/Assets/Resources/UI/FaceDetectUI.prefab index e7b6868..50c195c 100644 --- a/Assets/Resources/UI/FaceDetectUI.prefab +++ b/Assets/Resources/UI/FaceDetectUI.prefab @@ -27,15 +27,15 @@ RectTransform: m_GameObject: {fileID: 467468288701006585} 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_LocalScale: {x: 2, y: 2, z: 2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1305593576415872527} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + 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: 0, y: 0} + m_SizeDelta: {x: 250, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3738101260338914437 CanvasRenderer: @@ -58,15 +58,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.40392157, g: 0.40392157, b: 0.40392157, a: 1} 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: 21300000, guid: 447f19d95ff0c504da9f0a9dacc358d7, type: 3} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: 139541ce220ffc44fb9bf4993db13c99, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -109,6 +109,7 @@ RectTransform: - {fileID: 9023347130937077545} - {fileID: 4669846630367257996} - {fileID: 6569262126421687589} + - {fileID: 5009843812129736875} m_Father: {fileID: 6876832796388901115} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} @@ -259,8 +260,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -40} - m_SizeDelta: {x: -40, y: -120} + m_AnchoredPosition: {x: 0, y: -25} + m_SizeDelta: {x: -40, y: -150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1167518964908105557 CanvasRenderer: @@ -293,15 +294,15 @@ MonoBehaviour: m_text: New TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew TextNew Text m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: 581c047ed60765249b12f37ff2895497, type: 2} + m_sharedMaterial: {fileID: 21082280118058838, guid: 581c047ed60765249b12f37ff2895497, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4289572269 - m_fontColor: {r: 0.6784314, g: 0.6784314, b: 0.6784314, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -318,14 +319,14 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 + m_fontSize: 50 + m_fontSizeBase: 50 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 + m_fontStyle: 1 + m_HorizontalAlignment: 2 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -601,6 +602,81 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &3239961382231429169 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5009843812129736875} + - component: {fileID: 8934112858876014041} + - component: {fileID: 1813128883874316099} + m_Layer: 5 + m_Name: Lock + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5009843812129736875 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3239961382231429169} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1305593576415872527} + 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: 196.00002, y: 256} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8934112858876014041 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3239961382231429169} + m_CullTransparentMesh: 1 +--- !u!114 &1813128883874316099 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3239961382231429169} + 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: 1} + 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: 21300000, guid: a425b24d1df0f05429866e38afc635fa, type: 3} + 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 &3554032430536705821 GameObject: m_ObjectHideFlags: 0 @@ -888,15 +964,15 @@ RectTransform: m_GameObject: {fileID: 7404628379500909270} 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_LocalScale: {x: 2, y: 2, z: 2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1305593576415872527} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + 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: -40, y: -40} + m_SizeDelta: {x: 200, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1876079931168093812 CanvasRenderer: @@ -919,15 +995,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.44313726, g: 0.44313726, b: 0.44313726, a: 1} 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: 21300000, guid: bb72f5ca984e00d44aff91ecb54c2487, type: 3} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: e2acc6ce5792dd443944d679719895e7, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1030,7 +1106,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -30} + m_AnchoredPosition: {x: 0, y: -50} m_SizeDelta: {x: 200, y: 50} m_Pivot: {x: 0.5, y: 1} --- !u!222 &1808380685305513856 @@ -1063,14 +1139,14 @@ MonoBehaviour: m_Calls: [] m_text: New Text m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 11400000, guid: b04f3173f946b754db673ac13842f4c1, type: 2} + m_sharedMaterial: {fileID: 21728410361126204, guid: b04f3173f946b754db673ac13842f4c1, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 + rgba: 4294931249 m_fontColor: {r: 0.19215687, g: 0.4509804, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 diff --git a/Assets/Resources/UI/MainUI.prefab b/Assets/Resources/UI/MainUI.prefab index 781e4a3..ee17822 100644 --- a/Assets/Resources/UI/MainUI.prefab +++ b/Assets/Resources/UI/MainUI.prefab @@ -17,7 +17,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1958927731802958260 RectTransform: m_ObjectHideFlags: 0 @@ -134,7 +134,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.19607843} + m_Color: {r: 0.4862745, g: 0.6666667, b: 0.8784314, a: 0.19607843} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -163,6 +163,140 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 +--- !u!1 &2757657609315254747 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8411771944291717817} + - component: {fileID: 1982884316528622} + - component: {fileID: 3138386884910861036} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8411771944291717817 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2757657609315254747} + 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: 2576201504434113081} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1982884316528622 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2757657609315254747} + m_CullTransparentMesh: 1 +--- !u!114 &3138386884910861036 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2757657609315254747} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: CoDriver + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 194c956b3d864664890e731c63fd4a02, type: 2} + m_sharedMaterial: {fileID: 21704438749789640, guid: 194c956b3d864664890e731c63fd4a02, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4292702227 + m_fontColor: {r: 0.07450981, g: 0.4392157, b: 0.8666667, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 70 + m_fontSizeBase: 70 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &3239512571933529956 GameObject: m_ObjectHideFlags: 0 @@ -180,7 +314,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1051210256180514997 RectTransform: m_ObjectHideFlags: 0 @@ -238,6 +372,140 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &3276116198655259220 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3003885521091006085} + - component: {fileID: 4837327273038501092} + - component: {fileID: 6751648053537404087} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3003885521091006085 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3276116198655259220} + 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: 7867255813535008431} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4837327273038501092 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3276116198655259220} + m_CullTransparentMesh: 1 +--- !u!114 &6751648053537404087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3276116198655259220} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Driver + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 194c956b3d864664890e731c63fd4a02, type: 2} + m_sharedMaterial: {fileID: 21704438749789640, guid: 194c956b3d864664890e731c63fd4a02, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 70 + m_fontSizeBase: 70 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &4001795067869974423 GameObject: m_ObjectHideFlags: 0 @@ -297,7 +565,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.19607843} + m_Color: {r: 0.48235294, g: 0.6666667, b: 0.8784314, a: 0.23529412} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -343,7 +611,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1400966148747893423 RectTransform: m_ObjectHideFlags: 0 @@ -418,7 +686,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &4138242365235796459 RectTransform: m_ObjectHideFlags: 0 @@ -638,6 +906,81 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5461356057146944130 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724769963328776691} + - component: {fileID: 3008110882503550119} + - component: {fileID: 2265805038016120193} + m_Layer: 5 + m_Name: background_title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1724769963328776691 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5461356057146944130} + 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: 1888392902869825718} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3008110882503550119 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5461356057146944130} + m_CullTransparentMesh: 1 +--- !u!114 &2265805038016120193 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5461356057146944130} + 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: 1} + 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: 21300000, guid: 565c6bde9cad7a041bf103b2151526f4, type: 3} + 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 &5611881615064894930 GameObject: m_ObjectHideFlags: 0 @@ -677,11 +1020,12 @@ RectTransform: - {fileID: 1449208219289806508} - {fileID: 4138242365235796459} - {fileID: 173739580069041147} + - {fileID: 3003885521091006085} m_Father: {fileID: 1888392902869825718} 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: -300, y: 0} + m_AnchoredPosition: {x: -500, y: 0} m_SizeDelta: {x: 256, y: 256} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2054363549373963548 @@ -845,7 +1189,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &6599526536569391515 RectTransform: m_ObjectHideFlags: 0 @@ -920,7 +1264,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &6401048517044185304 RectTransform: m_ObjectHideFlags: 0 @@ -1144,7 +1488,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1449208219289806508 RectTransform: m_ObjectHideFlags: 0 @@ -1223,7 +1567,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &3140601927184870215 RectTransform: m_ObjectHideFlags: 0 @@ -1385,11 +1729,12 @@ RectTransform: - {fileID: 6401048517044185304} - {fileID: 1958927731802958260} - {fileID: 8940443638627649355} + - {fileID: 8411771944291717817} m_Father: {fileID: 1888392902869825718} 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: 300, y: 0} + m_AnchoredPosition: {x: 500, y: 0} m_SizeDelta: {x: 256, y: 256} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6645283475793646557 @@ -1551,6 +1896,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 1724769963328776691} - {fileID: 7867255813535008431} - {fileID: 2576201504434113081} - {fileID: 2472731737000828561} @@ -1620,7 +1966,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.19607843} + m_Color: {r: 0.4862745, g: 0.6666667, b: 0.8784314, a: 0.19607843} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 diff --git a/Assets/Resources/UI/SplashUI.prefab b/Assets/Resources/UI/SplashUI.prefab index ced3564..06a05e4 100644 --- a/Assets/Resources/UI/SplashUI.prefab +++ b/Assets/Resources/UI/SplashUI.prefab @@ -160,6 +160,140 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1545361635887485632 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1541122899319779203} + - component: {fileID: 2128977099815298311} + - component: {fileID: 8491918615249412914} + m_Layer: 0 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1541122899319779203 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1545361635887485632} + 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: 4633988811284681484} + 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: 800, y: 300} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2128977099815298311 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1545361635887485632} + m_CullTransparentMesh: 1 +--- !u!114 &8491918615249412914 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1545361635887485632} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: CareboX + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: b04f3173f946b754db673ac13842f4c1, type: 2} + m_sharedMaterial: {fileID: 21728410361126204, guid: b04f3173f946b754db673ac13842f4c1, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4283979864 + m_fontColor: {r: 0.34509805, g: 0.34509805, b: 0.34509805, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 200 + m_fontSizeBase: 200 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &4632708918913146321 GameObject: m_ObjectHideFlags: 0 @@ -190,6 +324,7 @@ RectTransform: m_Children: - {fileID: 1359963822425158848} - {fileID: 7608049162824954157} + - {fileID: 1541122899319779203} m_Father: {fileID: 6067314191371097767} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -215,7 +350,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &7608049162824954157 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Boot.unity b/Assets/Scenes/Boot.unity index 9942285..074a054 100644 --- a/Assets/Scenes/Boot.unity +++ b/Assets/Scenes/Boot.unity @@ -282,7 +282,7 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 832497118} + - {fileID: 1444775323} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -290,11 +290,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!224 &832497118 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - m_PrefabInstance: {fileID: 3911742382226554954} - m_PrefabAsset: {fileID: 0} --- !u!1 &844504214 GameObject: m_ObjectHideFlags: 0 @@ -594,103 +589,81 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 799b8be35b51f624db9b877baf209311, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1001 &3911742382226554954 -PrefabInstance: +--- !u!1 &1444775322 +GameObject: m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 793991319} - m_Modifications: - - target: {fileID: 4327728351019041244, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_Name - value: Background - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8805156796672989800, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 85c5c8dc06b4f49419cf4b1751725a67, type: 3} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1444775323} + - component: {fileID: 1444775325} + - component: {fileID: 1444775324} + m_Layer: 5 + m_Name: background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1444775323 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1444775322} + 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: 793991319} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1444775324 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1444775322} + 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: 1} + 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!222 &1444775325 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1444775322} + m_CullTransparentMesh: 1 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/FaceDetect.unity b/Assets/Scenes/FaceDetect.unity index 2b1fc96..89ad592 100644 --- a/Assets/Scenes/FaceDetect.unity +++ b/Assets/Scenes/FaceDetect.unity @@ -785,7 +785,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &1969623177 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Boot.cs b/Assets/Scripts/Boot.cs index 3f2dd5b..926b625 100644 --- a/Assets/Scripts/Boot.cs +++ b/Assets/Scripts/Boot.cs @@ -18,8 +18,6 @@ public class Boot : MonoBehaviour Application.targetFrameRate = 60; //设置屏幕不休眠 Screen.sleepTimeout = SleepTimeout.NeverSleep; - //设置屏幕方向 - Screen.orientation = ScreenOrientation.LandscapeLeft; _isInited = UIManager.IsInited; } diff --git a/Assets/Scripts/PoseCheck/EstimateModel/CVEstimator.cs b/Assets/Scripts/PoseCheck/EstimateModel/CVEstimator.cs index be3d755..44014f7 100644 --- a/Assets/Scripts/PoseCheck/EstimateModel/CVEstimator.cs +++ b/Assets/Scripts/PoseCheck/EstimateModel/CVEstimator.cs @@ -42,27 +42,22 @@ public class CVEstimator : Singleton break; } YogaManager.Instance.CurrentEstimator.Init(); - LogPrint.Log("Current Estimator Inited", PrintLevel.Important); //IsRunning = false; _mainThread = new Thread(new ThreadStart(MainThread)); _mainThread.Start(); IsInited = true; - - LogPrint.Log($"Inited:{IsInited}", PrintLevel.Important); } private void MainThread() { //瑙f瀽鏁版嵁 _estimateThread = new Thread(new ThreadStart(Estimation)); - LogPrint.Log("MainThread Executed"); } public void StartEstimation() { if (IsRunning) { - LogPrint.Log("Estimation running"); return; } if (!IsInited) @@ -111,19 +106,18 @@ public class CVEstimator : Singleton { try { - LogPrint.Log($"Estimation Thread Running!IsRunning:{IsRunning} {DateTime.Now}", PrintLevel.Important); Mat rgbaMat = YogaManager.Instance.RgbaMat; if (rgbaMat == null) { - LogPrint.Log("WebCamTexture is null. "); - LogPrint.Log("Re-Estimation."); + //LogPrint.Log("WebCamTexture is null. "); + //LogPrint.Log("Re-Estimation."); continue; //閲嶆柊妫娴 } Imgproc.cvtColor(rgbaMat, bgrMat, Imgproc.COLOR_RGBA2BGR); if (!YogaManager.Instance.CurrentEstimator.Esitmate(bgrMat, rgbaMat, out List points)) { - LogPrint.Log("Pose estimation failed. Re-Estimating."); + //LogPrint.Log("Pose estimation failed. Re-Estimating."); continue; //閲嶆柊妫娴 } diff --git a/Assets/Scripts/PoseCheck/HeadTurnDown.cs b/Assets/Scripts/PoseCheck/HeadTurnDown.cs index 46dad2f..c4fbf44 100644 --- a/Assets/Scripts/PoseCheck/HeadTurnDown.cs +++ b/Assets/Scripts/PoseCheck/HeadTurnDown.cs @@ -11,7 +11,7 @@ public class HeadTurnDown : PoseBase //蹇呰鐐逛綅 Nose Neck //璁$畻榧诲瓙鍒板ご棰堢煝閲 //return GetAverageVector(startPoint, endPoint, "Nose"); - return GetTwoPointAverageVector(startPoint, endPoint, "Nose", "Neck"); + return GetTwoPointAverageVector(startPoint, endPoint, "Neck", "Nose"); } protected override bool IsMovePoint(string tagName) diff --git a/Assets/Scripts/PoseCheck/HeadTurnUp.cs b/Assets/Scripts/PoseCheck/HeadTurnUp.cs index 5f1cb9c..3cdb3c2 100644 --- a/Assets/Scripts/PoseCheck/HeadTurnUp.cs +++ b/Assets/Scripts/PoseCheck/HeadTurnUp.cs @@ -11,7 +11,7 @@ public class HeadTurnUp : PoseBase //蹇呰鐐逛綅 Nose Neck //璁$畻榧诲瓙鍒板ご棰堢煝閲 //return GetAverageVector(startPoint, endPoint, "Nose"); - return GetTwoPointAverageVector(startPoint, endPoint, "Nose", "Neck"); + return GetTwoPointAverageVector(startPoint, endPoint, "Neck", "Nose"); } protected override bool IsMovePoint(string tagName) diff --git a/Assets/Scripts/PoseCheck/HoldPosition.cs b/Assets/Scripts/PoseCheck/HoldPosition.cs index e0c7526..f0a8dc6 100644 --- a/Assets/Scripts/PoseCheck/HoldPosition.cs +++ b/Assets/Scripts/PoseCheck/HoldPosition.cs @@ -1,10 +1,46 @@ 锘縰sing OpenCVForUnity.CoreModule; using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; public class HoldPosition : PoseBase { + public override bool? AnalyzingAction(List<(DateTime, List)> points, bool isDataReGather = false) + { + if (points.Count < 2) // 0绾у疄鐜伴昏緫 涓嶅仛鎿嶄綔 + return null; + + var distance = Vector2.zero; + TimeSpan totalTimeSpan = TimeSpan.MinValue; + + var startPoint = points.FirstOrDefault().Item2; + var endPoint = points.LastOrDefault().Item2; + + var startDir = "Nose".vector(startPoint) - "Neck".vector(startPoint); + var endDir = "Nose".vector(endPoint) - "Neck".vector(endPoint); + + var angle = Vector2.SignedAngle(startDir, endDir); + + + for (int i = 0; i < points.Count - 1; i++) + { + var p1 = points[i].Item2; + var p2 = points[i + 1].Item2; + + var vector = GetBasicVectorDirection(p1, p2); + distance += vector; + + TimeSpan timeSpan = points[i + 1].Item1 - points[i].Item1; + totalTimeSpan = timeSpan; + } + + LogPrint.Warning($"angle: {angle}", PrintLevel.Normal); + LogPrint.Log($"distance: {distance}, totalTimeSpan: {totalTimeSpan}", PrintLevel.Normal); + + return (angle < 10 || MovementValidation(distance, totalTimeSpan, 1).GetValueOrDefault()); + } + public override Vector2 GetBasicVectorDirection(List startPoint, List endPoint) { List vectors = new List(); @@ -30,7 +66,7 @@ public class HoldPosition : PoseBase //淇濇寔濮垮娍涓嶅彂鐢熺Щ鍔 - if (distance.magnitude < 10f)//鍏佽涓瀹氳宸 + if (distance.magnitude < 15f)//鍏佽涓瀹氳宸 { //EventManager.Instance.Dispatch(YogaEventType.Action_Success); return true; diff --git a/Assets/Scripts/PoseCheck/PoseBase.cs b/Assets/Scripts/PoseCheck/PoseBase.cs index 1eead61..3d2ccd1 100644 --- a/Assets/Scripts/PoseCheck/PoseBase.cs +++ b/Assets/Scripts/PoseCheck/PoseBase.cs @@ -28,15 +28,15 @@ public abstract class PoseBase /// /// 渚︽祴涓ゅ抚涔嬮棿鐨勫钩鍧囩煝閲 /// - /// 璧峰甯 - /// 缁撴潫甯 - /// 蹇呴』涓哄繀瑕佺偣 - /// 蹇呴』涓哄繀瑕佺偣 + /// 璧峰甯 + /// 缁撴潫甯 + /// 蹇呴』涓哄繀瑕佺偣 + /// 蹇呴』涓哄繀瑕佺偣 /// - protected Vector2 GetTwoPointAverageVector(List startPoint, List endPoint, string movePoint, string staticPoint) + protected Vector2 GetTwoPointAverageVector(List firstPoints, List lastPoints, string startPoint, string endPoint) { - Vector2 startEyeV = new Vector2((float)movePoint.p(startPoint).x - (float)staticPoint.p(startPoint).x, (float)movePoint.p(startPoint).y - (float)staticPoint.p(startPoint).y); - Vector2 endEyeV = new Vector2((float)movePoint.p(endPoint).x - (float)staticPoint.p(endPoint).x, (float)movePoint.p(endPoint).y - (float)staticPoint.p(endPoint).y); + Vector2 startEyeV = new Vector2((float)startPoint.p(firstPoints).x - (float)endPoint.p(firstPoints).x, (float)startPoint.p(firstPoints).y - (float)endPoint.p(firstPoints).y); + Vector2 endEyeV = new Vector2((float)startPoint.p(lastPoints).x - (float)endPoint.p(lastPoints).x, (float)startPoint.p(lastPoints).y - (float)endPoint.p(lastPoints).y); return endEyeV - startEyeV; } diff --git a/Assets/Scripts/Service/YogaManager.cs b/Assets/Scripts/Service/YogaManager.cs index 0aac4d3..11dbe11 100644 --- a/Assets/Scripts/Service/YogaManager.cs +++ b/Assets/Scripts/Service/YogaManager.cs @@ -132,8 +132,6 @@ public class YogaManager : MonoSingleton EventManager.Instance.AddEventListener(YogaEventType.Action_SpeedTooFast, ExtraSpeedTooFast); } - - private void OnDisable() { EventManager.Instance.RemoveEventListener(YogaEventType.UI_LevelFinished, ClearingSettlement); @@ -195,6 +193,7 @@ public class YogaManager : MonoSingleton //閲囨牱璐ㄩ噺璇勪及 public bool? SampleQualityEvaluation(AvatarAction actionType, DateTime startTime, DateTime endTime) { + var pointsSource = new List<(DateTime, List)>(_estimateKeyPointsCache); //鑾峰彇鏃堕棿闂撮殧鍐呯殑鎵鏈夌偣鍙婂悜閲忓彉鍖 var framePoints = _estimateKeyPointsCache.Where(x => x.Item1 >= startTime && x.Item1 <= endTime).ToList(); if (framePoints == null) diff --git a/Assets/Scripts/Test/TestGuideUI.cs b/Assets/Scripts/Test/TestGuideUI.cs index 554fd6c..1219e8d 100644 --- a/Assets/Scripts/Test/TestGuideUI.cs +++ b/Assets/Scripts/Test/TestGuideUI.cs @@ -16,7 +16,6 @@ public class TestGuideUI : UIPanelBase //计时进度条 private Image _progressBar; private DateTime _startTime; - private float _totalSeconds; //面板显示数据 private TextMeshProUGUI _successText; @@ -146,12 +145,6 @@ public class TestGuideUI : UIPanelBase } YogaData data = pageData[0] as YogaData; - _totalSeconds = data.TotalSeconds; - if (_totalSeconds == 0) - { - LogPrint.Error("TotalSeconds is 0"); - return; - } //重置显示数据 if (_successText != null) @@ -185,7 +178,7 @@ public class TestGuideUI : UIPanelBase private void ProgressUpdate() { var passedTime = Math.Abs((_startTime - DateTime.Now).TotalSeconds); - _progressBar.fillAmount = (float)(passedTime / _totalSeconds); + _progressBar.fillAmount = (float)(passedTime / GuideMgr.AnimationLength); } public override void OnEnter() diff --git a/Assets/Scripts/UI/Component/CaptureManagerBase.cs b/Assets/Scripts/UI/Component/CaptureManagerBase.cs index 5f9c01d..ad2d434 100644 --- a/Assets/Scripts/UI/Component/CaptureManagerBase.cs +++ b/Assets/Scripts/UI/Component/CaptureManagerBase.cs @@ -39,18 +39,6 @@ namespace Yoga private void Awake() { Init(); - InvokeRepeating("GCCollection", 0, 1f); - } - private void GCCollection() - { - if (_isOnCamCapture && enabled == true && gameObject.activeInHierarchy == true) - StartCoroutine(CleanUp()); - } - private IEnumerator CleanUp() - { - GC.Collect(); - yield return Resources.UnloadUnusedAssets(); - GC.Collect(); } public void Init() { @@ -59,7 +47,7 @@ namespace Yoga MatInitial(); CVEstimator.Instance.Init();//濮挎佹娴嬫ā鍨嬪垵濮嬪寲 } - + private void OnEnable() { EventRegist(); @@ -91,18 +79,21 @@ namespace Yoga { YogaManager.Instance.RgbaMat = img.clone(); + if (YogaManager.Instance.PersonRectResult.Count > 0) + { + var box = YogaManager.Instance.PersonRectResult[0]; + float left = box[0]; + float top = box[1]; + float right = box[2]; + float bottom = box[3]; + //Imgproc.rectangle(img, new Point(left, top), new Point(right, bottom), new Scalar(0, 0, 255), 5, 3); + + DrawAimBox(img, left + 10, top + 10, right - 10, bottom - 10, 40); + } + //鎵撳嵃 if (GlobalData.Instance.IsEstimationPrintMode) { - if (YogaManager.Instance.PersonRectResult.Count > 0) - { - var box = YogaManager.Instance.PersonRectResult[0]; - float left = box[0]; - float top = box[1]; - float right = box[2]; - float bottom = box[3]; - Imgproc.rectangle(img, new Point(left, top), new Point(right, bottom), new Scalar(0, 0, 255), 20); - } //YogaManager.Instance.CurrentEstimator.DebugPrint(ref img); if (YogaManager.Instance.CurrEstimateKeyPoints != null && YogaManager.Instance.CurrEstimateKeyPoints.Count > 0) @@ -122,9 +113,9 @@ namespace Yoga if (points[idFrom] != null && points[idTo] != null) { - Imgproc.line(img, points[idFrom], points[idTo], new Scalar(0, 255, 0), 3); - Imgproc.ellipse(img, points[idFrom], new Size(3, 3), 0, 0, 360, new Scalar(0, 0, 255), Core.FILLED); - Imgproc.ellipse(img, points[idTo], new Size(3, 3), 0, 0, 360, new Scalar(0, 0, 255), Core.FILLED); + Imgproc.line(img, points[idFrom], points[idTo], new Scalar(255, 255, 255), 3); + Imgproc.ellipse(img, points[idFrom], new Size(3, 3), 0, 0, 360, new Scalar(255, 0, 0), Core.FILLED); + Imgproc.ellipse(img, points[idTo], new Size(3, 3), 0, 0, 360, new Scalar(255, 0, 0), Core.FILLED); } } } @@ -134,6 +125,27 @@ namespace Yoga Utils.matToTexture2D(img, DisplayTexture); } + private static void DrawAimBox(Mat img, float left, float top, float right, float bottom, int lineLength) + { + Imgproc.cvtColor(img, img, Imgproc.COLOR_RGBA2RGB); + + //鐣岄潰钃 RGB = 19, 115, 230 + Imgproc.rectangle(img, new Point(left, top), new Point(right, bottom), new Scalar(255, 255, 255, 50), 2, 3); + //鍙充笅瑙 + Imgproc.line(img, new Point(right, bottom), new Point(right - lineLength, bottom), new Scalar(255, 255, 255, 255), 10, 3); + Imgproc.line(img, new Point(right, bottom), new Point(right, bottom - lineLength), new Scalar(255, 255, 255, 255), 10, 3); + //宸︿笅瑙 + Imgproc.line(img, new Point(left, bottom), new Point(left + lineLength, bottom), new Scalar(255, 255, 255, 255), 10, 3); + Imgproc.line(img, new Point(left, bottom), new Point(left, bottom - lineLength), new Scalar(255, 255, 255, 255), 10, 3); + //鍙充笂瑙 + Imgproc.line(img, new Point(right, top), new Point(right - lineLength, top), new Scalar(255, 255, 255, 255), 10, 3); + Imgproc.line(img, new Point(right, top), new Point(right, top + lineLength), new Scalar(255, 255, 255, 255), 10, 3); + //宸︿笂瑙 + Imgproc.line(img, new Point(left, top), new Point(left + lineLength, top), new Scalar(255, 255, 255, 255), 10, 3); + Imgproc.line(img, new Point(left, top), new Point(left, top + lineLength), new Scalar(255, 255, 255, 255), 10, 3); + Imgproc.cvtColor(img, img, Imgproc.COLOR_RGB2RGBA); + } + private void OnDestroy() { OnRelease(); @@ -170,12 +182,12 @@ namespace Yoga protected virtual void ManagerEnable() { - + } protected virtual void ManagerDisable() { - + } protected virtual void EventRemove() diff --git a/Assets/Scripts/UI/Component/GudieAnimationManager.cs b/Assets/Scripts/UI/Component/GudieAnimationManager.cs index 10e2de3..6d7957c 100644 --- a/Assets/Scripts/UI/Component/GudieAnimationManager.cs +++ b/Assets/Scripts/UI/Component/GudieAnimationManager.cs @@ -2,13 +2,37 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.UIElements; public class GudieAnimationManager : MonoBehaviour { private Animator _animator; private string _currName; + private bool _isAnimationStartPlay; private List _actionList = new List(); + private List _actionNameList = new List(); + + private float _animationLength = 0; + public float AnimationLength + { + get + { + if (_animationLength == 0) + { + AnimationClip[] clips = Animator.runtimeAnimatorController.animationClips; + foreach (AnimationClip clip in clips) + { + if (_actionNameList.Contains(clip.name)) + { + _animationLength += clip.length; + } + } + } + return _animationLength; + } + } + public Animator Animator { get @@ -21,11 +45,30 @@ public class GudieAnimationManager : MonoBehaviour } } + public List ActionNameList + { + get + { + if (_actionNameList.Count == 0) + { + foreach (var item in Enum.GetNames(typeof(AvatarAction))) + { + _actionNameList.Add(item); + } + } + return _actionNameList; + } + } + + private void Awake() { _animator = transform.GetComponentInChildren(); + _isAnimationStartPlay = false; } + + public void Play(string name) { Animator.CrossFade(name, 0.5f); @@ -34,8 +77,20 @@ public class GudieAnimationManager : MonoBehaviour public void PlayCurrentActionList(List actionList) { + _isAnimationStartPlay = true; _actionList = actionList; - YogaManager.Instance.ActionIndex = 0; + + AnimationClip[] clips = Animator.runtimeAnimatorController.animationClips; + _animationLength = 0; + foreach (AnimationClip clip in clips) + { + if (_actionNameList.Contains(clip.name)) + { + _animationLength += clip.length; + } + } + + Play(Enum.GetName(typeof(AvatarAction), _actionList[YogaManager.Instance.ActionIndex])); } @@ -43,8 +98,19 @@ public class GudieAnimationManager : MonoBehaviour { if (string.IsNullOrEmpty(_currName)) return; + + if (!_isAnimationStartPlay) + return; + + var currName = GetCurrentAnimationName(); + if (!ActionNameList.Contains(currName)) + { + Play(ActionNameList[YogaManager.Instance.ActionIndex]); + return; + } + //褰撴湭杈惧埌鎸囨爣涓斿姩鐢绘挱鏀惧畬姣曟椂锛岄噸鏂版挱鏀 - if (Animator.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1.0f) + if (Animator.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1.0f && GetCurrentAnimationName().Equals(Enum.GetName(typeof(AvatarAction), _actionList[YogaManager.Instance.ActionIndex]))) { //濡傛灉鍒楄〃鍔ㄧ敾index灏忎簬鍒楄〃闀垮害锛屾挱鏀句笅涓涓姩鐢 YogaManager.Instance.ActionIndex++; @@ -59,6 +125,22 @@ public class GudieAnimationManager : MonoBehaviour } } + private string GetCurrentAnimationName() + { + if (Animator == null) + { + return string.Empty; + } + var clipInfo = Animator.GetCurrentAnimatorClipInfo(0); + + if (clipInfo.Length > 0) + { + var name = clipInfo[0].clip.name; + return name; + } + return string.Empty; + } + public void Stop() { Animator.StopPlayback(); diff --git a/Assets/Scripts/UI/Component/MotionUSBCameraCaptureManager.cs b/Assets/Scripts/UI/Component/MotionUSBCameraCaptureManager.cs index 0006179..50b1f14 100644 --- a/Assets/Scripts/UI/Component/MotionUSBCameraCaptureManager.cs +++ b/Assets/Scripts/UI/Component/MotionUSBCameraCaptureManager.cs @@ -15,8 +15,20 @@ namespace Yoga private void Awake() { _flipImg = Resources.Load("Materials/Unlit_FlipHorizontal"); + InvokeRepeating("GCCollection", 0, 1f); } + protected void GCCollection() + { + if (_isOnCamCapture && enabled == true && gameObject.activeInHierarchy == true) + StartCoroutine(CleanUp()); + } + protected IEnumerator CleanUp() + { + GC.Collect(); + yield return Resources.UnloadUnusedAssets(); + GC.Collect(); + } protected override void ManagerEnable() { GlobalData.Instance.IsFlip = true; @@ -30,7 +42,6 @@ namespace Yoga { Mat img = null; - LogPrint.Log("USB Camera!"); if (UVCManager.Instance != null && UVCManager.Instance.GetAttachedDevices() != null && UVCManager.Instance.GetAttachedDevices().Count > 0) { @@ -38,12 +49,10 @@ namespace Yoga for (int i = 0; i < devices.Count; i++) { UVCManager.CameraInfo device = devices[i]; - LogPrint.Log($"id:{i},pid:{device.Pid},vid:{device.Vid},deviceName:{device.DeviceName}"); } var index = PlayerPrefs.GetInt("USBCameraIndex"); if (index >= devices.Count || index < 0) //鏁伴噺瓒呭嚭鏃跺欐敼涓洪粯璁ょ涓涓 index = 0; - LogPrint.Log($"current ID {index} name:" + devices[index].DeviceName); if (devices[index].previewTexture == null) throw new Exception("No preview Texture found!"); @@ -52,7 +61,6 @@ namespace Yoga img = new Mat(UVCManager.Instance.DefaultHeight, UVCManager.Instance.DefaultWidth, CvType.CV_8UC3); Utils.texture2DToMat(tmpTex, img); } - return img; } diff --git a/Assets/Scripts/UI/Component/PanelItemManager.cs b/Assets/Scripts/UI/Component/PanelItemManager.cs index ffe42d1..563c5eb 100644 --- a/Assets/Scripts/UI/Component/PanelItemManager.cs +++ b/Assets/Scripts/UI/Component/PanelItemManager.cs @@ -1,5 +1,6 @@ using TMPro; using UnityEngine; +using UnityEngine.UI; public class PanelItemManager : MonoBehaviour { @@ -10,5 +11,22 @@ public class PanelItemManager : MonoBehaviour { Title = transform.Find("Title").GetComponent(); Description = transform.Find("Description").GetComponent(); + transform.Find("Lock").gameObject.SetActive(false); + transform.Find("background").GetComponent().color = new Color(1, 1, 1, 1); + Description.gameObject.SetActive(true); + } + + public void Lock() + { + transform.Find("Lock").gameObject.SetActive(true); + transform.Find("background").GetComponent().color = new Color(0.5f, 0.5f, 0.5f, 0.5f); + Description.gameObject.SetActive(false); + } + + public void UnLock() + { + transform.Find("Lock").gameObject.SetActive(false); + transform.Find("background").GetComponent().color = new Color(1, 1, 1, 1); + Description.gameObject.SetActive(true); } } diff --git a/Assets/Scripts/UI/FaceDetectUI.cs b/Assets/Scripts/UI/FaceDetectUI.cs index 65145d9..f9eaf2f 100644 --- a/Assets/Scripts/UI/FaceDetectUI.cs +++ b/Assets/Scripts/UI/FaceDetectUI.cs @@ -8,6 +8,7 @@ public class FaceDetectUI : UIPanelBase private Dictionary itemDetail = new Dictionary(); private Transform _content; + private List _lockedItem = new List() { "Blond_Hair", "Wearing_Hat" }; private void Awake() { @@ -37,6 +38,9 @@ public class FaceDetectUI : UIPanelBase foreach (var item in items) { + if (item.Key.Equals("Bald")) + continue; + GameObject go; if (index < count) { @@ -56,6 +60,16 @@ public class FaceDetectUI : UIPanelBase mgr.Description.text = item.Value; go.transform.gameObject.SetActive(true); go.transform.SetSiblingIndex(index); + + if (_lockedItem.Contains(item.Key)) + { + mgr.Lock(); + } + else + { + mgr.UnLock(); + } + index++; } } diff --git a/Assets/Scripts/UI/GuideUI.cs b/Assets/Scripts/UI/GuideUI.cs index 01ca746..8c808a9 100644 --- a/Assets/Scripts/UI/GuideUI.cs +++ b/Assets/Scripts/UI/GuideUI.cs @@ -16,7 +16,6 @@ public class GuideUI : UIPanelBase //计时进度条 private Image _progressBar; private DateTime _startTime; - private float _totalSeconds; //面板显示数据 private TextMeshProUGUI _successText; @@ -78,12 +77,6 @@ public class GuideUI : UIPanelBase return; } - if (animeType is AvatarAction) - { - GuideMgr.Play(Enum.GetName(typeof(AvatarAction), animeType)); - return; - } - if (animeType is List) { var actionList = animeType as List; @@ -146,12 +139,6 @@ public class GuideUI : UIPanelBase } YogaData data = pageData[0] as YogaData; - _totalSeconds = data.TotalSeconds; - if (_totalSeconds == 0) - { - LogPrint.Error("TotalSeconds is 0"); - return; - } //重置显示数据 if (_successText != null) @@ -185,7 +172,7 @@ public class GuideUI : UIPanelBase private void ProgressUpdate() { var passedTime = Math.Abs((_startTime - DateTime.Now).TotalSeconds); - _progressBar.fillAmount = (float)(passedTime / _totalSeconds); + _progressBar.fillAmount = (float)(passedTime / GuideMgr.AnimationLength); } public override void OnEnter() @@ -193,9 +180,8 @@ public class GuideUI : UIPanelBase base.OnEnter(); _guide.SetActive(true); EventManager.Instance.Dispatch(YogaEventType.StartMotionCapture); + YogaManager.Instance.ActionIndex = 0; EventManager.Instance.Dispatch(YogaEventType.PlayAnimation, YogaManager.Instance.LevelData.Actions); - //EventManager.Instance.Dispatch(YogaEventType.PlayAnimation, YogaManager.Instance.LevelData.Action); - _startTime = DateTime.Now; InvokeRepeating("ProgressUpdate", 0, 0.05f); //20fps } diff --git a/Assets/Scripts/YogaDataLoader.cs b/Assets/Scripts/YogaDataLoader.cs index c8807d9..78ab8cd 100644 --- a/Assets/Scripts/YogaDataLoader.cs +++ b/Assets/Scripts/YogaDataLoader.cs @@ -14,11 +14,10 @@ public class YogaDataLoader data[-1] = new YogaData() { VideoPath = "Video/Action3", - Actions = new List() { AvatarAction.SitUpright, AvatarAction.HeadShake }, - Action = AvatarAction.Nod, + Actions = new List() { AvatarAction.SitUpright, AvatarAction.Nod }, + //Action = AvatarAction.Nod, ModelType = ModelType.OpenPose, MaxCheckPointCount = 1000, - TotalSeconds = 20.0f, RectCutRate = 0.2f, MustPoints = new List() { "Nose", "Neck" },//{"REye", "LEye"} //AnyPoints = new List() { "RWrist", "LWrist" } @@ -28,10 +27,9 @@ public class YogaDataLoader { VideoPath = "Video/Action1", Actions = new List() { AvatarAction.SitUpright, AvatarAction.HeadShake }, - Action = AvatarAction.HeadShake, + //Action = AvatarAction.HeadShake, ModelType = ModelType.OpenPose, MaxCheckPointCount = 4, - TotalSeconds = 20.0f, RectCutRate = 0.25f, MustPoints = new List() { "Nose", /*"REye", "LEye", */"Neck" } }; @@ -39,10 +37,9 @@ public class YogaDataLoader { VideoPath = "Video/Action2", Actions = new List() { AvatarAction.SitUpright, AvatarAction.Nod }, - Action = AvatarAction.Nod, + //Action = AvatarAction.Nod, ModelType = ModelType.OpenPose, MaxCheckPointCount = 4, - TotalSeconds = 20.0f, RectCutRate = 0.25f, MustPoints = new List() { "Nose",/* "REye", "LEye", */"Neck" } }; @@ -50,10 +47,9 @@ public class YogaDataLoader { VideoPath = "Video/Action3", Actions = new List() { AvatarAction.SitUpright, AvatarAction.LateralHead }, - Action = AvatarAction.LateralHead, + //Action = AvatarAction.LateralHead, ModelType = ModelType.OpenPose, MaxCheckPointCount = 4, - TotalSeconds = 12.66f, MustPoints = new List() { "REye", "LEye" } }; @@ -72,10 +68,9 @@ public class YogaData { public string VideoPath; internal List Actions; - public AvatarAction Action; + //public AvatarAction Action; public ModelType ModelType; public int MaxCheckPointCount; - public float TotalSeconds; public float RectCutRate; public List MustPoints = new List(); public List AnyPoints = new List(); diff --git a/Assets/UI/Img/background_title.png b/Assets/UI/Img/background_title.png new file mode 100644 index 0000000000000000000000000000000000000000..dcdce5785e1310b2d871300e1418da5955384262 GIT binary patch literal 4355 zcmeAS@N?(olHy`uVBq!ia0y~yUNjEX09v zF>6wv6Q=RYvn)&bdUbkdp6>kpvN3dmX` zo#A}Nq0sB3>w_>{D8H40%iZk2(izTbUMMur#gY(aQ$e7h4*~_9bSN~B{n^!Rz%p5^2nDY{fPz6f6io9% z!Jc#|IJ_DPy@TU6DhRWg=7mBlAp2_pVYXI4-kex#!fdU8?0LjuxLzM*S9bvmWsnYq zRzUvKC}cQ?Hb9~G5>Ew$;d)~buRmb8<~s_N5N5Mj5egpwNN0t;-mmF800000NkvXX Hu0mjf^^tfw literal 0 HcmV?d00001 diff --git a/Assets/UI/Img/healthCard.png.meta b/Assets/UI/Img/healthCard.png.meta new file mode 100644 index 0000000..9d8a90d --- /dev/null +++ b/Assets/UI/Img/healthCard.png.meta @@ -0,0 +1,124 @@ +fileFormatVersion: 2 +guid: e2acc6ce5792dd443944d679719895e7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 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: 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: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UI/Img/healthCardShadow.png b/Assets/UI/Img/healthCardShadow.png new file mode 100644 index 0000000000000000000000000000000000000000..99200f1c3e1e4eb88c8f180a6f95eefc7ea65324 GIT binary patch literal 3929 zcmc&%={MU6+x{u4!=MLzb*WEF-yvHthE)d7W`5P<^wn=@=}X~J5}uedogKV0wUq(JIq<}>Uy zzlGjF7v4RWEQZ;o>^$BSe5sGsaFpLe)nT_O*8#qw=DCk7mR$1QPQu2^U(GFycf?-; z#KIz@t25i10{poO%!w%2_3@(}m6ufG;%57ejEvTHc5H~HbyfG(cI4xS|Aed>4j8qk z?1DL(b_9XlR)T;IEV!Ts*n}5y?X7KX1GD(kf?<(}eOwYqJdBu4K1UTCX7N1E(RC{~ zd6QcROm-Id`+nnGY;6(r8_E5d)srvEUg5d|GomfAx%=7U77_Nsb)R) z^GLAFCwr(!O_g~vwz1Dj@h_P~k1X!bm;id&>_t-MjGD;U*g?3!06ynA;@xoA>*QB` ze6pJoiK}H<;eAdxTAU*B+lA_r=v;B$=WeXGILugV=;D$LZz5G%-sU%RG~`lGGUE11%lZ=Yk^qlJPrbnbXbT_o>M zo+T{=82ZHz$2w$arXHHm-G7HE{1n{u>jLA?~vub5}$lC=16)KcO~ z3C_z_dE0z9*OOvL+MN=aP@hEsT0v`>Q@YQ}5VMG4?5;%M!2;P9?JW|GF(v2chGPyF zg;O0s444RElp!PXTn^ z!xE&S^so++SRYmXk+M*Hrdh`#$`7Mr1J3Kb1jY{+@5}K0I0GU6t}K)u{K1 zw1rEwz&|=-o?HS8Elm;n2y%S4q9F{g1pcX3otC1u%3owc^VBL6YgJh^M+&6XT=1u!5!j9dDBLY;IPvDE zH^bqaaTPRb)OJL4MkH$81Ma_7?t0NIyjl(i9p2$C_~izOwcpKgzubtGTuyoFtJcKY zt@{c6q7egcg4`PqJc5#~hx;P&FQ|Pvv+x@!mCGLSu2&wg_J}UXe|S_gS3VW<_TEgO zQR_8-tgzyVuPVV{wf9;%o50KJ%9tw#$Bz%jO_0}fw>Yl@kn^-Zt#bFYFA#paqX#w- z@?Y3`U~|WvUYPY%%%I{$D&8+@_^Ld|5khZ!VxQwuwXl5I7nTEBR>}C-APjp;9ej#I zRd}$dJoDNF>pWX$j)DDmIsL2j0V4VLqO7&@nY6jUBkt~f%7iELS4(_mn|0_vmActd zTg-308ep78d1isk^+StQxFCeWNav447(dVGnx^4vTwXlyLvemmP_MgFx+hMQ&`2 z(pZ?FSUBl;OQdCiT+aMhh;@l@St^P3;XqINcsPu~`Hg=cDoz0o{|k>3=^>Z+Kd|1- z7u2XrpC{Lc9&1O(JlmxJ5o3$2bvC$$4nItDkHdTLGWWE^y)G_TJGT)|WV~=v(VlB<~t-o@}ma`gpLj zQ_r2Ocg%eAQ!%*yADp(8l$68U(+%+1#L&$0X|z`Jy;#iK4^r&lHR5wmws$*0(;W{i z-Euai9KzZ5mPD(3zKn+j-Vor*%tE0nT&nCzDT?Uj~w!pI#I1(1XVfEDHk>Jw*>m>n>#OLe@wDO%9-~^DS&>@lf|IvKDyvEAr z9}H9^v`j1g7iNy07|!MqfzUq!f)wM(k=o+_B%c9rT{_ptu`of_(Ca6uK5OWhxCD7_ z#>`MrjM5^z=;4F{kj0(XkC7L2C-8-dSKr)CE9}}EIvckleW(5Jx*e_U`ff*9Jz>0g zd%f!1{i6%;{`F$!2By?6#57hgTT}EctO9O+plUAArEwmrQc9$(*Jw`E6*TAczS9iS z?=6Lu2>wYMNC8Z#vrS2#&Q5a1BF;mh#L!lD6K@gs#K7vAPQsYm{Bh9c;oJ8OCVma` zF0+@%Htg3T#JHY%nu)pWDF#g*@H*|5I#reI>N;j!L62-?_7r->30Mt7EPPoP-6Ptl zK<06}c5zc1u`KG%j~w!!$c^jI$o~{-qaZT-G?DuuW5IT~E%t-rRX!HB#kKcorc8TxONR+4p zs|>4`k%vEY;%r8E>vc39O#^;|_3TOe6J?G_{@3);q_PbM?9~G~)1&?wTch%_?&|Dc zl>3xzRR)z#8YP7o_ixuyi2bXH4YYyOH+ zkSNNqAKEX^=`8nzM-6X6XTM?5uv~Qc<&C#6l>ph$KeE(8yB*j~sZGeR_>UgfJ}ZE@ z(mm^O)@{wZHzNuj^TH1Gg)(E%y%M`h(SgoHN8~lpZMX<$-zN$|_y+BL#Sq7g>0~yd zS%-tAHpL+Wmor&a0`9}V9AXm2b(@*tVd2)GnLIOp3pPk?LzE&Ny z?W8$!AyK*enudc2$8^X8!S8#6s+Z7W?)3M(@@@=t)pl1Kv;#5SlRIieQ^ZID$0cJ* zx4F>YKDz$sGXu%r@@q7BA&u^ye5%7+3m5UH*UZ&;vic>|7m?<>yEqn=N(qs2H*G>! z4KU*?E?7g zuvU%g1>dU|^f?JXZK8uoVDtJ#)s!F60RqGrITm2Q$v4PvOAJq<>0uB{_M3B)w7(15 zkR!~X9z6480_1F$j8;`Q)6}pq{H&C`v4g@$p+OCu+-}z z%c+7i<6Gfr!y)S#DwZmhb)AiDaa`34xwjCAY`yJY;y}fKNo#2abN%uj`1-A<2tzIF zn<<8y!%|U^<&?zR`>X1zamGrKXeBPO+_jfFq#K*OF^uI#-$5FN@YQkVGHn5F5(;^D zY-dPwj}{8oMhU+El8sSrI_b|UE!}rQOX>Pr%|A~ZM|EX)Po_0%7Wj@{S9o&Sm5TJwTrP()s@YJ8PUtXw@2KoNG&q3rJ?IEkP| zunaa&>G`n+g!WijS`@ZCJWCV;%!*iH)scUy^SGt;l*@sRf4}FMc{I!iq|D(Kd zBw@oJ7}s+DD@$qvB!r$=O5eZv`$7YiEE97Hfz4rcn*(YhsxfAi!>B*18n9h=vOO;8 zkb*{T`tk@pcASlYJ@~n-=3M9!q6Zp1X%B2XHb(V5{X7Au<8Gb?+ZQkI)SWh!I(Spk z%hFq^m7`_l{{2;?jf#u|xVn(soub3spZQ<+W+Pi!n<98gIjXw5Xp!F}`SnmR?|318 z?QZeGo2qADl^wi(;A>PcY~Ymp!?5xhdG5>Sum9Q812i6b**r9`!oY|?cGukb>n2W$2Go-Y<_q{TJfV;vd7Xokp53zsBR{#J2 literal 0 HcmV?d00001 diff --git a/Assets/UI/Img/healthCardShadow.png.meta b/Assets/UI/Img/healthCardShadow.png.meta new file mode 100644 index 0000000..4054ecb --- /dev/null +++ b/Assets/UI/Img/healthCardShadow.png.meta @@ -0,0 +1,124 @@ +fileFormatVersion: 2 +guid: 139541ce220ffc44fb9bf4993db13c99 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + 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 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 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: 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: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UVC4UnityAndroidPlugin/Scripts/UVCManager.cs b/Assets/UVC4UnityAndroidPlugin/Scripts/UVCManager.cs index 0f34c2e..f63bede 100644 --- a/Assets/UVC4UnityAndroidPlugin/Scripts/UVCManager.cs +++ b/Assets/UVC4UnityAndroidPlugin/Scripts/UVCManager.cs @@ -498,7 +498,7 @@ namespace Serenegiant.UVC { //return FilterDevice(device.name); - if (device.name == "/dev/bus/usb/002/007") + if (IsIRDevice(device)) return false; if ((UVCDrawers == null) || (UVCDrawers.Length == 0)) @@ -530,12 +530,25 @@ namespace Serenegiant.UVC /// /// /// - bool FilterDevice(string deviceName) + bool IsIRDevice(UVCDevice device) { - Debug.Log(deviceName + " :" + (deviceName == "/dev/bus/usb/002/008")); - return deviceName == "/dev/bus/usb/002/008"; +#if UNITY_ANDROID + AndroidJavaClass util = new AndroidJavaClass("com.unity3d.player.USBCamUtil"); + bool f = util.CallStatic("CamIsIR", device.name); + Debug.Log(device.name + " 杩囨护缁撴灉锛" + f); + return f; +#endif + } + void PrintAllDevices() + { + AndroidJavaClass util = new AndroidJavaClass("com.unity3d.player.USBCamUtil"); + string[] strs = util.CallStatic("GetAllDevice"); + Debug.Log("璁惧鏁伴噺锛" + strs.Length); + foreach (var item in strs) + { + Debug.Log(item); + } } - /** * UVC姗熷櫒銇屽彇銈婂銇曘倢銇熴仺銇嶃伄鍑︾悊銇疅浣 * @param info diff --git a/Packages/manifest.json b/Packages/manifest.json index f297402..46b8f47 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -3,7 +3,6 @@ "com.unity.2d.sprite": "1.0.0", "com.unity.adaptiveperformance": "5.0.2", "com.unity.adaptiveperformance.google.android": "1.1.2", - "com.unity.adaptiveperformance.samsung.android": "5.0.0", "com.unity.feature.characters-animation": "1.0.0", "com.unity.ide.visualstudio": "2.0.22", "com.unity.memoryprofiler": "1.1.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index c8d7945..6d8c850 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -31,15 +31,6 @@ }, "url": "https://packages.unity.cn" }, - "com.unity.adaptiveperformance.samsung.android": { - "version": "5.0.0", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.adaptiveperformance": "5.0.0" - }, - "url": "https://packages.unity.cn" - }, "com.unity.animation.rigging": { "version": "1.2.1", "depth": 1,