Преглед изворни кода

5/10更新

2025/5/8 取消交互时候其他狗隐藏功能。隐藏后再出现,会出现摄像机无法定位,狗位置漂移问题。
2025/5/9 将hug的动画变更为attack_L。后台变量未变,如果效果好的话,以后变更。
2025/5/10 初步完成手势收集,读取,写入,比对功能。待后续验证。
Jees пре 4 недеља
родитељ
комит
db4654b4d9

+ 4 - 4
Assets/Resources/Data/languages.json

@@ -335,16 +335,16 @@
             "zh-cn": "录音失败。请再试一次。"
         },
         "commandHug_00": {
-            "en": "Are you ready? Now you can give <<dog_name>> the command to hug.",
-            "zh-cn": "准备好了吗?现在可以说出口令让<<dog_name>>抱抱。"
+            "en": "Are you ready? Now you can give <<dog_name>> the command to touch you.",
+            "zh-cn": "准备好了吗?现在可以说出口令让<<dog_name>>握手。"
         },
         "commandHug_01": {
             "en": "Record again. Ensure that the two recordings are consistent.",
             "zh-cn": "再输入一次。确保两次录音一致。"
         },
         "commandHug_10": {
-            "en": "Now <<dog_name>> will hug when you give it a command.<br>Talk to <<dog_name>> often, and it will be more obedient.",
-            "zh-cn": "<<dog_name>>现在会听从你的抱抱指令了。<br>经常训练<<dog_name>>,它会更听话哦。"
+            "en": "Now <<dog_name>> will touch you when you give it a command.<br>Talk to <<dog_name>> often, and it will be more obedient.",
+            "zh-cn": "<<dog_name>>现在会听从你的握手指令了。<br>经常训练<<dog_name>>,它会更听话哦。"
         },
         "commandHug_20": {
             "en": "Record fail. Please try again.",

+ 3 - 3
Assets/Resources/Dog/AnimatorController/shibaInu/HomeDogAnimatorController.controller

@@ -1091,7 +1091,7 @@ AnimatorState:
   m_MirrorParameterActive: 0
   m_CycleOffsetParameterActive: 0
   m_TimeParameterActive: 0
-  m_Motion: {fileID: 3858329934085553762, guid: 1a349bfe663f8a848a567303e35c613a, type: 3}
+  m_Motion: {fileID: 0}
   m_Tag: 
   m_SpeedParameter: 
   m_MirrorParameter: 
@@ -1868,9 +1868,9 @@ AnimatorStateTransition:
   m_Mute: 0
   m_IsExit: 0
   serializedVersion: 3
-  m_TransitionDuration: 1.9739349
+  m_TransitionDuration: 0.89340866
   m_TransitionOffset: 0
-  m_ExitTime: 4.848769e-10
+  m_ExitTime: 3.422275e-10
   m_HasExitTime: 1
   m_HasFixedDuration: 1
   m_InterruptionSource: 0

+ 2 - 2
Assets/Resources/Dog/AnimatorController/shibaInu/HomeDogInteractController.controller

@@ -468,7 +468,7 @@ AnimatorState:
   m_MirrorParameterActive: 0
   m_CycleOffsetParameterActive: 0
   m_TimeParameterActive: 0
-  m_Motion: {fileID: -5205147620392676281, guid: 1a349bfe663f8a848a567303e35c613a, type: 3}
+  m_Motion: {fileID: 5849466765502975326, guid: 0faf4e66268a11e4d982d9a0163734ca, type: 3}
   m_Tag: 
   m_SpeedParameter: 
   m_MirrorParameter: 
@@ -776,7 +776,7 @@ AnimatorState:
   m_MirrorParameterActive: 0
   m_CycleOffsetParameterActive: 0
   m_TimeParameterActive: 0
-  m_Motion: {fileID: 3858329934085553762, guid: 0faf4e66268a11e4d982d9a0163734ca, type: 3}
+  m_Motion: {fileID: -3339085233561973423, guid: 1a349bfe663f8a848a567303e35c613a, type: 3}
   m_Tag: 
   m_SpeedParameter: 
   m_MirrorParameter: 

+ 1 - 1
Assets/Resources/Item/Materials/frisbee/Orange.mat

@@ -118,7 +118,7 @@ Material:
     - _ZWrite: 1
     m_Colors:
     - _BaseColor: {r: 1, g: 0.6250977, b: 0, a: 1}
-    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _Color: {r: 1, g: 0.6250977, b: 0, a: 1}
     - _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
     - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
   m_BuildTextureStacks: []

+ 7 - 7
Assets/Resources/VoiceAndManu/MenuController.cs

@@ -296,13 +296,13 @@ public class MenuController : MonoBehaviour
                     // HomeController.dogsInScene[GameData.focusDog].dogState = DogState.INTERACT;
                     HomeController.dogsInScene[GameData.focusDog].SetupInteract();
                     // 其他狗进入隐藏模式
-                    foreach (var otherDog in HomeController.dogsInScene)
-                    {
-                        if (otherDog.dogProperty.d_id != focusDogId)
-                        {
-                            otherDog.gameObject.SetActive(false);
-                        }
-                    }
+                    //foreach (var otherDog in HomeController.dogsInScene)
+                    //{
+                    //    if (otherDog.dogProperty.d_id != focusDogId)
+                    //    {
+                    //        otherDog.gameObject.SetActive(false);
+                    //    }
+                    //}
                 }
             }
             HomeSoundEffectController.Instance.PlaySoundEffect(5);

+ 1 - 1
Assets/Resources/VoiceAndManu/VoiceAndMenu.uxml

@@ -1,7 +1,7 @@
 <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
     <Style src="project://database/Assets/Resources/VoiceAndManu/VoiceAndMenu.uss?fileID=7433441132597879392&amp;guid=ce67c533d6e849b47862283007c81f9a&amp;type=3#VoiceAndMenu" />
     <ui:VisualElement style="flex-grow: 1; background-size: 300% 100%;">
-        <ui:VisualElement name="quit" style="flex-grow: 1; position: absolute; top: 20px; right: 20px; background-image: url(&quot;project://database/Assets/Pictures/quit.png?fileID=2800000&amp;guid=cd0b7f033ffb46346b2c4d0d11593000&amp;type=3#quit&quot;); width: 30px; height: 30px; -unity-background-image-tint-color: rgb(24, 24, 24);" />
+        <ui:VisualElement name="quit" style="flex-grow: 1; position: absolute; top: 10px; right: 10px; background-image: url(&quot;project://database/Assets/Pictures/quit.png?fileID=2800000&amp;guid=cd0b7f033ffb46346b2c4d0d11593000&amp;type=3#quit&quot;); width: 30px; height: 30px; -unity-background-image-tint-color: rgb(24, 24, 24);" />
         <ui:VisualElement name="menuArea" style="flex-grow: 1; position: absolute; top: 360px; right: 0; width: 150px; height: 150px; visibility: visible;">
             <ui:VisualElement name="shop" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/menu%20icons/shop.png?fileID=2800000&amp;guid=6866a7131c552244286e086c0f3c0d71&amp;type=3#shop&quot;); top: 103px; left: 38px; display: flex;" />
             <ui:VisualElement name="warehouse" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/menu%20icons/box.png?fileID=2800000&amp;guid=e023858a18ba6044aac5f01454022545&amp;type=3#box&quot;); top: 71px; left: 29px;" />

+ 3 - 3
Assets/Scenes/Home.unity

@@ -12662,7 +12662,7 @@ Camera:
     width: 1
     height: 1
   near clip plane: 0.3
-  far clip plane: 1000
+  far clip plane: 200
   field of view: 60.000004
   orthographic: 0
   orthographic size: 5
@@ -13747,7 +13747,7 @@ MonoBehaviour:
     FieldOfView: 30
     OrthographicSize: 5
     NearClipPlane: 0.3
-    FarClipPlane: 1000
+    FarClipPlane: 200
     Dutch: 0
     ModeOverride: 0
     LensShift: {x: 0, y: 0}
@@ -14399,7 +14399,7 @@ MonoBehaviour:
     FieldOfView: 60.000004
     OrthographicSize: 5
     NearClipPlane: 0.3
-    FarClipPlane: 1000
+    FarClipPlane: 200
     Dutch: 0
     ModeOverride: 0
     LensShift: {x: 0, y: 0}

+ 8 - 0
Assets/Scenes/Test Scene.meta

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

+ 512 - 0
Assets/Scenes/Test Scene.unity

@@ -0,0 +1,512 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+OcclusionCullingSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_OcclusionBakeSettings:
+    smallestOccluder: 5
+    smallestHole: 0.25
+    backfaceThreshold: 100
+  m_SceneGUID: 00000000000000000000000000000000
+  m_OcclusionCullingData: {fileID: 0}
+--- !u!104 &2
+RenderSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 10
+  m_Fog: 0
+  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+  m_FogMode: 3
+  m_FogDensity: 0.01
+  m_LinearFogStart: 0
+  m_LinearFogEnd: 300
+  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+  m_AmbientIntensity: 1
+  m_AmbientMode: 0
+  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
+  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+  m_HaloStrength: 0.5
+  m_FlareStrength: 1
+  m_FlareFadeSpeed: 3
+  m_HaloTexture: {fileID: 0}
+  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+  m_DefaultReflectionMode: 0
+  m_DefaultReflectionResolution: 128
+  m_ReflectionBounces: 1
+  m_ReflectionIntensity: 1
+  m_CustomReflection: {fileID: 0}
+  m_Sun: {fileID: 0}
+  m_UseRadianceAmbientProbe: 0
+--- !u!157 &3
+LightmapSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 13
+  m_BakeOnSceneLoad: 0
+  m_GISettings:
+    serializedVersion: 2
+    m_BounceScale: 1
+    m_IndirectOutputScale: 1
+    m_AlbedoBoost: 1
+    m_EnvironmentLightingMode: 0
+    m_EnableBakedLightmaps: 1
+    m_EnableRealtimeLightmaps: 0
+  m_LightmapEditorSettings:
+    serializedVersion: 12
+    m_Resolution: 2
+    m_BakeResolution: 40
+    m_AtlasSize: 1024
+    m_AO: 0
+    m_AOMaxDistance: 1
+    m_CompAOExponent: 1
+    m_CompAOExponentDirect: 0
+    m_ExtractAmbientOcclusion: 0
+    m_Padding: 2
+    m_LightmapParameters: {fileID: 0}
+    m_LightmapsBakeMode: 1
+    m_TextureCompression: 1
+    m_ReflectionCompression: 2
+    m_MixedBakeMode: 2
+    m_BakeBackend: 1
+    m_PVRSampling: 1
+    m_PVRDirectSampleCount: 32
+    m_PVRSampleCount: 512
+    m_PVRBounces: 2
+    m_PVREnvironmentSampleCount: 256
+    m_PVREnvironmentReferencePointCount: 2048
+    m_PVRFilteringMode: 1
+    m_PVRDenoiserTypeDirect: 1
+    m_PVRDenoiserTypeIndirect: 1
+    m_PVRDenoiserTypeAO: 1
+    m_PVRFilterTypeDirect: 0
+    m_PVRFilterTypeIndirect: 0
+    m_PVRFilterTypeAO: 0
+    m_PVREnvironmentMIS: 1
+    m_PVRCulling: 1
+    m_PVRFilteringGaussRadiusDirect: 1
+    m_PVRFilteringGaussRadiusIndirect: 1
+    m_PVRFilteringGaussRadiusAO: 1
+    m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+    m_PVRFilteringAtrousPositionSigmaIndirect: 2
+    m_PVRFilteringAtrousPositionSigmaAO: 1
+    m_ExportTrainingData: 0
+    m_TrainingDataDestination: TrainingData
+    m_LightProbeSampleCountMultiplier: 4
+  m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
+  m_LightingSettings: {fileID: 0}
+--- !u!196 &4
+NavMeshSettings:
+  serializedVersion: 2
+  m_ObjectHideFlags: 0
+  m_BuildSettings:
+    serializedVersion: 3
+    agentTypeID: 0
+    agentRadius: 0.5
+    agentHeight: 2
+    agentSlope: 45
+    agentClimb: 0.4
+    ledgeDropHeight: 0
+    maxJumpAcrossDistance: 0
+    minRegionArea: 2
+    manualCellSize: 0
+    cellSize: 0.16666667
+    manualTileSize: 0
+    tileSize: 256
+    buildHeightMesh: 0
+    maxJobWorkers: 0
+    preserveTilesOutsideBounds: 0
+    debug:
+      m_Flags: 0
+  m_NavMeshData: {fileID: 0}
+--- !u!1 &347493355
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 347493358}
+  - component: {fileID: 347493357}
+  - component: {fileID: 347493356}
+  m_Layer: 0
+  m_Name: Main Camera
+  m_TagString: MainCamera
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!81 &347493356
+AudioListener:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 347493355}
+  m_Enabled: 1
+--- !u!20 &347493357
+Camera:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 347493355}
+  m_Enabled: 1
+  serializedVersion: 2
+  m_ClearFlags: 1
+  m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
+  m_projectionMatrixMode: 1
+  m_GateFitMode: 2
+  m_FOVAxisMode: 0
+  m_Iso: 200
+  m_ShutterSpeed: 0.005
+  m_Aperture: 16
+  m_FocusDistance: 10
+  m_FocalLength: 50
+  m_BladeCount: 5
+  m_Curvature: {x: 2, y: 11}
+  m_BarrelClipping: 0.25
+  m_Anamorphism: 0
+  m_SensorSize: {x: 36, y: 24}
+  m_LensShift: {x: 0, y: 0}
+  m_NormalizedViewPortRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+  near clip plane: 0.3
+  far clip plane: 1000
+  field of view: 60
+  orthographic: 0
+  orthographic size: 5
+  m_Depth: -1
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_RenderingPath: -1
+  m_TargetTexture: {fileID: 0}
+  m_TargetDisplay: 0
+  m_TargetEye: 3
+  m_HDR: 1
+  m_AllowMSAA: 1
+  m_AllowDynamicResolution: 0
+  m_ForceIntoRT: 0
+  m_OcclusionCulling: 1
+  m_StereoConvergence: 10
+  m_StereoSeparation: 0.022
+--- !u!4 &347493358
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 347493355}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 1, z: -10}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &801546032
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 801546033}
+  - component: {fileID: 801546034}
+  - component: {fileID: 801546035}
+  m_Layer: 0
+  m_Name: Player
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &801546033
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 801546032}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: -4.760311, y: -1.0233593, z: 5.7006884}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &801546034
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 801546032}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Actions: {fileID: -944628639613478452, guid: 77f61ea1d743de54c8271041233d7234, type: 3}
+  m_NotificationBehavior: 2
+  m_UIInputModule: {fileID: 0}
+  m_DeviceLostEvent:
+    m_PersistentCalls:
+      m_Calls: []
+  m_DeviceRegainedEvent:
+    m_PersistentCalls:
+      m_Calls: []
+  m_ControlsChangedEvent:
+    m_PersistentCalls:
+      m_Calls: []
+  m_ActionEvents:
+  - m_PersistentCalls:
+      m_Calls:
+      - m_Target: {fileID: 801546035}
+        m_TargetAssemblyTypeName: PlayerGestureController, Assembly-CSharp
+        m_MethodName: GestureAction
+        m_Mode: 0
+        m_Arguments:
+          m_ObjectArgument: {fileID: 0}
+          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+          m_IntArgument: 0
+          m_FloatArgument: 0
+          m_StringArgument: 
+          m_BoolArgument: 0
+        m_CallState: 2
+    m_ActionId: 14ff0a3e-63b0-4954-abf7-c5d409f71c16
+    m_ActionName: Player/Gesture
+  m_NeverAutoSwitchControlSchemes: 0
+  m_DefaultControlScheme: 
+  m_DefaultActionMap: Player
+  m_SplitScreenIndex: -1
+  m_Camera: {fileID: 0}
+--- !u!114 &801546035
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 801546032}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 47852a50d335dd9499f14d1d61b72f00, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+--- !u!1 &1772971345
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1772971348}
+  - component: {fileID: 1772971347}
+  - component: {fileID: 1772971346}
+  m_Layer: 0
+  m_Name: EventSystem
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &1772971346
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1772971345}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_SendPointerHoverToParent: 1
+  m_MoveRepeatDelay: 0.5
+  m_MoveRepeatRate: 0.1
+  m_XRTrackingOrigin: {fileID: 0}
+  m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
+  m_DeselectOnBackgroundClick: 1
+  m_PointerBehavior: 0
+  m_CursorLockBehavior: 0
+  m_ScrollDeltaPerTick: 6
+--- !u!114 &1772971347
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1772971345}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_FirstSelected: {fileID: 0}
+  m_sendNavigationEvents: 1
+  m_DragThreshold: 10
+--- !u!4 &1772971348
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1772971345}
+  serializedVersion: 2
+  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: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1811293280
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1811293282}
+  - component: {fileID: 1811293281}
+  - component: {fileID: 1811293283}
+  m_Layer: 0
+  m_Name: Directional Light
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!108 &1811293281
+Light:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1811293280}
+  m_Enabled: 1
+  serializedVersion: 11
+  m_Type: 1
+  m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
+  m_Intensity: 1
+  m_Range: 10
+  m_SpotAngle: 30
+  m_InnerSpotAngle: 21.80208
+  m_CookieSize: 10
+  m_Shadows:
+    m_Type: 2
+    m_Resolution: -1
+    m_CustomResolution: -1
+    m_Strength: 1
+    m_Bias: 0.05
+    m_NormalBias: 0.4
+    m_NearPlane: 0.2
+    m_CullingMatrixOverride:
+      e00: 1
+      e01: 0
+      e02: 0
+      e03: 0
+      e10: 0
+      e11: 1
+      e12: 0
+      e13: 0
+      e20: 0
+      e21: 0
+      e22: 1
+      e23: 0
+      e30: 0
+      e31: 0
+      e32: 0
+      e33: 1
+    m_UseCullingMatrixOverride: 0
+  m_Cookie: {fileID: 0}
+  m_DrawHalo: 0
+  m_Flare: {fileID: 0}
+  m_RenderMode: 0
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_RenderingLayerMask: 1
+  m_Lightmapping: 4
+  m_LightShadowCasterMode: 0
+  m_AreaSize: {x: 1, y: 1}
+  m_BounceIntensity: 1
+  m_ColorTemperature: 6570
+  m_UseColorTemperature: 0
+  m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
+  m_UseBoundingSphereOverride: 0
+  m_UseViewFrustumForShadowCasterCull: 1
+  m_ForceVisible: 0
+  m_ShadowRadius: 0
+  m_ShadowAngle: 0
+  m_LightUnit: 1
+  m_LuxAtDistance: 1
+  m_EnableSpotReflector: 1
+--- !u!4 &1811293282
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1811293280}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
+  m_LocalPosition: {x: 0, y: 3, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+--- !u!114 &1811293283
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1811293280}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Version: 3
+  m_UsePipelineSettings: 1
+  m_AdditionalLightsShadowResolutionTier: 2
+  m_LightLayerMask: 1
+  m_RenderingLayers: 1
+  m_CustomShadowLayers: 0
+  m_ShadowLayerMask: 1
+  m_ShadowRenderingLayers: 1
+  m_LightCookieSize: {x: 1, y: 1}
+  m_LightCookieOffset: {x: 0, y: 0}
+  m_SoftShadowQuality: 0
+--- !u!1660057539 &9223372036854775807
+SceneRoots:
+  m_ObjectHideFlags: 0
+  m_Roots:
+  - {fileID: 347493358}
+  - {fileID: 1811293282}
+  - {fileID: 801546033}
+  - {fileID: 1772971348}

+ 7 - 0
Assets/Scenes/Test Scene.unity.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 5351cbae9580b0b419bf430afca9d23e
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 45 - 0
Assets/Scenes/Test Scene/GestureInput.inputactions

@@ -0,0 +1,45 @@
+{
+    "name": "GestureInput",
+    "maps": [
+        {
+            "name": "Player",
+            "id": "cb0ffbfc-cfc7-4d4f-86c5-29195067aa55",
+            "actions": [
+                {
+                    "name": "Gesture",
+                    "type": "Button",
+                    "id": "14ff0a3e-63b0-4954-abf7-c5d409f71c16",
+                    "expectedControlType": "",
+                    "processors": "",
+                    "interactions": "",
+                    "initialStateCheck": false
+                }
+            ],
+            "bindings": [
+                {
+                    "name": "",
+                    "id": "c4641e11-8be7-4291-a3d2-c575d78a3813",
+                    "path": "<Mouse>/leftButton",
+                    "interactions": "Hold",
+                    "processors": "",
+                    "groups": "",
+                    "action": "Gesture",
+                    "isComposite": false,
+                    "isPartOfComposite": false
+                },
+                {
+                    "name": "",
+                    "id": "ca915298-f972-45f4-a5e7-34af92c47232",
+                    "path": "<Touchscreen>/Press",
+                    "interactions": "Hold",
+                    "processors": "",
+                    "groups": "",
+                    "action": "Gesture",
+                    "isComposite": false,
+                    "isPartOfComposite": false
+                }
+            ]
+        }
+    ],
+    "controlSchemes": []
+}

+ 14 - 0
Assets/Scenes/Test Scene/GestureInput.inputactions.meta

@@ -0,0 +1,14 @@
+fileFormatVersion: 2
+guid: 77f61ea1d743de54c8271041233d7234
+ScriptedImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 2
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
+  script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
+  generateWrapperCode: 0
+  wrapperCodePath: 
+  wrapperClassName: 
+  wrapperCodeNamespace: 

+ 1 - 1
Assets/Scripts/Develop Script/TestSetup.cs

@@ -49,7 +49,7 @@ public class TestSetup : MonoBehaviour
 
         if (EnviromentSetting.languageData == null)
         {
-            EnviromentController.InitialGameEnviroment();
+            //EnviromentController.InitialGameEnviroment();
 
         }
     }

+ 3 - 0
Assets/Scripts/EnviromentSetting.cs

@@ -46,6 +46,9 @@ public static class EnviromentSetting
     // todo 正式版设定为release 未来从服务器获取
     public static string runEnv = "Test"; // NA, Test, Release
 
+    // 语音识别通过分数
+    public static float voiceRecognitionScore = 0.6f;
+
 }
 
 

+ 0 - 96
Assets/Scripts/Functions/Gesture/GestureController.cs

@@ -1,96 +0,0 @@
-using Newtonsoft.Json;
-using NUnit.Framework;
-using System.Collections.Generic;
-using System.Net.Sockets;
-using UnityEngine;
-
-/* 本文件用于控制手势的采集和比对
- * 也包含导出和导入手势的功能
-*/
-public class GestureController
-{
-    // Start is called once before the first execution of Update after the MonoBehaviour is created
-    private List<GesturePointOffset> gesturePointOffsetList = new List<GesturePointOffset>();
-    public int sampleRate { private set; get; } = 10;        // 采样率
-    private Vector2 prePointLoc = new Vector2(0, 0); // 第一个点
-    private Vector2 curPointLoc = new Vector2(0, 0); // 第二个点
-
-    public string ExportToJson()
-    {
-        string json = string.Empty;
-        if (gesturePointOffsetList.Count / 2 <= sampleRate) { return json; }
-        json = JsonConvert.SerializeObject(this);
-        return json;
-    }
-
-    public void ImportFromJson(string json)
-    {
-        var data = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
-        this.sampleRate = int.Parse(data["sample_rate"]);
-        gesturePointOffsetList.Clear();
-        GesturePointOffset[] pointOffsets = JsonConvert.DeserializeObject<GesturePointOffset[]>(data["points"]);
-        foreach (var point in pointOffsets)
-        {
-            gesturePointOffsetList.Add(point);
-        }
-    }
-
-    // 添加一个运动轨迹
-    public void AddGesturePoint(Vector2 pointLoc)
-    {
-        if (gesturePointOffsetList.Count == 0)
-        {
-            prePointLoc = pointLoc;
-            curPointLoc = pointLoc;
-            GesturePointOffset gesturePointMovement = new GesturePointOffset(0, 0);
-            gesturePointOffsetList.Add(gesturePointMovement);
-            return;
-        }
-        else
-        {
-            curPointLoc = pointLoc;
-            float distance = Vector2.Distance(prePointLoc, curPointLoc);
-            float angle = Vector2.Angle(prePointLoc, curPointLoc);
-            GesturePointOffset gesturePointMovement = new GesturePointOffset(distance, angle);
-            gesturePointOffsetList.Add(gesturePointMovement);
-            prePointLoc = curPointLoc;
-        }
-    }
-
-    public float CompareGesture(GestureController anotherGesture)
-    {
-        float score = 0f;
-        if (this.sampleRate != anotherGesture.sampleRate)
-        {
-            Debug.Log("Sample rate not match");
-            return -1f;
-        }
-
-        int maxGesturePoints = Mathf.Max(this.gesturePointOffsetList.Count, anotherGesture.gesturePointOffsetList.Count);
-        int minGesturePoints = Mathf.Min(this.gesturePointOffsetList.Count, anotherGesture.gesturePointOffsetList.Count);
-        for (int i = 0; i < minGesturePoints; i++)
-        {
-
-            float ditanceMin = Mathf.Min(this.gesturePointOffsetList[i].distance - anotherGesture.gesturePointOffsetList[i].distance);
-            float ditanceMax = Mathf.Max(this.gesturePointOffsetList[i].distance - anotherGesture.gesturePointOffsetList[i].distance);
-            float distanceScore = ditanceMin / ditanceMax;
-
-            float angleMin = Mathf.Min(this.gesturePointOffsetList[i].angle - anotherGesture.gesturePointOffsetList[i].angle);
-            float angleMax = Mathf.Max(this.gesturePointOffsetList[i].angle - anotherGesture.gesturePointOffsetList[i].angle);
-            float angleDitance1 = angleMax - angleMin;
-            float angleDitance2 = 360 - angleDitance1;
-            float angleScore = 1 - (Mathf.Min(angleDitance1, angleDitance2) / 180);
-
-            score = score * (i / (i + 1)) + (distanceScore + angleScore) / 2 * (1f / (i + 1));
-        }
-
-        // 如果长度超过20%,就要考虑调整score
-        if ((maxGesturePoints / minGesturePoints) > 1.2f)
-        {
-            int deltaGesturePoints = Mathf.RoundToInt(maxGesturePoints - minGesturePoints * 1.2f);
-            score = score * (minGesturePoints / (minGesturePoints + deltaGesturePoints));
-        }
-
-        return score;
-    }
-}

+ 138 - 0
Assets/Scripts/Functions/Gesture/GestureManager.cs

@@ -0,0 +1,138 @@
+using Newtonsoft.Json;
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Net.Sockets;
+using UnityEngine;
+using UnityEngine.InputSystem;
+
+/* 本文件用于控制手势的采集和比对
+ * 也包含导出和导入手势的功能
+*/
+public class GestureManager
+{
+    // Start is called once before the first execution of Update after the MonoBehaviour is created
+    public List<GesturePointOffset> gesturePointOffsetList { set; get; } = new List<GesturePointOffset>();
+    public int sampleRate { set; get; } = 10;        // 采样率
+    private Vector2 prePointLoc = new Vector2(0, 0); // 第一个点
+    private Vector2 curPointLoc = new Vector2(0, 0); // 第二个点
+    private float timer = 0f;
+    public bool isRecording;
+    private float interval;
+    private float lengthTorrence = 0.25f; // 允许的长度误差
+
+    public GestureManager()
+    {
+        interval = (float)1 / sampleRate;
+    }
+
+    public string ExportToJson()
+    {
+        string json = string.Empty;
+        if (gesturePointOffsetList.Count / 2 <= sampleRate) { return json; }
+        json = JsonConvert.SerializeObject(this);
+        return json;
+    }
+
+    public void ImportFromJson(string json)
+    {
+        this.isRecording = false;
+        var data = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
+        this.sampleRate = int.Parse(data["sampleRate"].ToString());
+        gesturePointOffsetList.Clear();
+        GesturePointOffset[] pointOffsets = JsonConvert.DeserializeObject<GesturePointOffset[]>(data["gesturePointOffsetList"].ToString());
+        foreach (var point in pointOffsets)
+        {
+            gesturePointOffsetList.Add(point);
+        }
+    }
+
+    // 添加一个运动轨迹
+    public void Record()
+    {
+        Vector2 pointLoc = Pointer.current.position.ReadValue();
+        if (isRecording)
+        {
+            if (gesturePointOffsetList.Count == 0)
+            {
+                prePointLoc = pointLoc;
+                curPointLoc = pointLoc;
+                GesturePointOffset gesturePointMovement = new GesturePointOffset(0, 0);
+                gesturePointOffsetList.Add(gesturePointMovement);
+                return;
+            }
+            else
+            {
+                //Debug.Log("interval:" + interval.ToString());
+                timer += Time.deltaTime;
+                if (timer >= interval)
+                {
+                    timer = 0f;
+
+                    curPointLoc = pointLoc;
+                    float distance = Vector2.Distance(prePointLoc, curPointLoc);
+                    float angle = Vector2.Angle(prePointLoc, curPointLoc);
+                    GesturePointOffset gesturePointMovement = new GesturePointOffset(distance, angle);
+
+                    if (distance * angle != 0)
+                    {
+                        gesturePointOffsetList.Add(gesturePointMovement);
+                        Debug.Log("log time:" + DateTime.Now.ToString());
+                    }
+                    prePointLoc = curPointLoc;
+                }
+            }
+        }
+    }
+
+    public float CompareGesture(GestureManager anotherGesture)
+    {
+        float score = 0f;
+        if (this.sampleRate != anotherGesture.sampleRate)
+        {
+            Debug.Log("Sample rate not match");
+            return -1f;
+        }
+
+        int maxGesturePoints = Mathf.Max(this.gesturePointOffsetList.Count, anotherGesture.gesturePointOffsetList.Count);
+        int minGesturePoints = Mathf.Min(this.gesturePointOffsetList.Count, anotherGesture.gesturePointOffsetList.Count);
+        for (int i = 0; i < minGesturePoints; i++)
+        {
+
+            float distanceMin = Mathf.Min(this.gesturePointOffsetList[i].distance - anotherGesture.gesturePointOffsetList[i].distance);
+            float distanceMax = Mathf.Max(this.gesturePointOffsetList[i].distance - anotherGesture.gesturePointOffsetList[i].distance);
+            float angleMin = Mathf.Min(this.gesturePointOffsetList[i].angle - anotherGesture.gesturePointOffsetList[i].angle);
+            float angleMax = Mathf.Max(this.gesturePointOffsetList[i].angle - anotherGesture.gesturePointOffsetList[i].angle);
+
+            float distanceScore = 0f;
+            if (distanceMin == 0)
+            {
+                distanceScore = 1f;
+            }
+            else
+            {
+                distanceScore = distanceMin / distanceMax;
+            }
+
+            float angleDitance1 = angleMax - angleMin;
+            float angleDitance2 = 360 - angleDitance1;
+            float angleScore = 1 - (Mathf.Min(angleDitance1, angleDitance2) / 180);
+
+            score = score * (i / (i + 1f)) + (distanceScore + angleScore) / 2 * (1f / (i + 1));
+        }
+
+        // 如果长度超过公差范围,就要考虑调整score
+        if ((maxGesturePoints / minGesturePoints) > (1f+ lengthTorrence))
+        {
+            int deltaGesturePoints = Mathf.RoundToInt(maxGesturePoints - minGesturePoints * (1f + lengthTorrence));
+            score = score * (minGesturePoints / (minGesturePoints + deltaGesturePoints));
+        }
+
+        return score;
+    }
+
+    public void ResetGesture()
+    {
+        this.gesturePointOffsetList.Clear();
+    }
+}

+ 0 - 0
Assets/Scripts/Functions/Gesture/GestureController.cs.meta → Assets/Scripts/Functions/Gesture/GestureManager.cs.meta


+ 3 - 0
Assets/Scripts/Functions/Gesture/GesturePointOffset.cs

@@ -1,5 +1,6 @@
 using UnityEngine;
 using Newtonsoft.Json;
+using System;
 
 /* GesturePointOffset 每一个定位点相对于上一个定位点的偏移量
  */
@@ -8,12 +9,14 @@ public class GesturePointOffset
 {
     public float distance { set; get; } = 0f; // 两个点之间的距离
     public float angle { set; get; } = 0f;// 两个点之间的角度
+    private DateTime time { set; get; }
 
 
     public GesturePointOffset(float distance, float angle)
     {
         this.distance = distance;
         this.angle = angle;
+        time = DateTime.Now;
     }
     public string ExportToJson()
     {

+ 11 - 26
Assets/Scripts/Home/DogInScene.cs

@@ -194,10 +194,12 @@ public class DogInScene //: ScriptableObject
 
         TimeSpan ts = new TimeSpan();
         ts = DateTime.Now - this.interactAnimationStartTime;
-        if (ts.TotalSeconds < 6){
+        if (ts.TotalSeconds < 6)
+        {
             yield return new WaitForSeconds(0.25f);
         }
-        else{
+        else
+        {
             Debug.Log("InteractAnimation count down stop:" + this.gameObject.name);
             this.ResetAnimationStatus();
         }
@@ -253,7 +255,7 @@ public class DogInScene //: ScriptableObject
     // 宠物随机移动
     public void RandomMove()
     {
-
+        //this.animator.SetBool("isMoving", true);
         // 如果距离目标小于0.5米就把速度调整为零
         if (Vector3.Distance(moveToLocation, this.gameObject.transform.position) < 0.5f)
         {
@@ -274,10 +276,12 @@ public class DogInScene //: ScriptableObject
             this.animator.SetBool("isMoving", true);
             this.animator.SetFloat("moveSpeed", this.moveSpeed);
         }
-        this.gameObject.transform.LookAt(moveToLocation);
-        this.gameObject.transform.position = Vector3.MoveTowards(gameObject.transform.position, moveToLocation, dogProperty.runSpeed * (1 + moveSpeed) * 0.02f * moveSpeedAdj);  // 第一个0.02对应50帧fixupdate画面,后面一个数字对应速度调整,对应RM动画
-        //this.gameObject.transform.position = Vector3.MoveTowards(gameObject.transform.position, moveToLocation, (100 + dogProperty.runSpeed) * (1 + moveSpeed) * 0.02f * 0.015f);  // 第一个0.02对应50帧fixupdate画面,后面一个数字对应速度调整,对应IF动画
-        //Debug.Log("current position:" + gameObject.transform.position.x + "z:" + gameObject.transform.position.z);
+        if (this.animator.GetBool("isMoving"))
+        {
+            this.gameObject.transform.LookAt(moveToLocation);
+            this.gameObject.transform.position = Vector3.MoveTowards(gameObject.transform.position, moveToLocation, dogProperty.runSpeed * (1 + moveSpeed) * 0.02f * moveSpeedAdj);  // 第一个0.02对应50帧fixupdate画面,后面一个数字对应速度调整,对应RM动画
+        }
+
 
         // 如果狗距离到达重点就停止跑步动画
         float distance = Vector3.Distance(gameObject.transform.position, moveToLocation);
@@ -321,25 +325,6 @@ public class DogInScene //: ScriptableObject
         this.dogState = DogState.LISTEN;
     }
 
-    // 用来出来音频返回结果
-    //public void PostListenRequest(bool result)
-    //{
-    //    if (result)
-    //    {
-    //        // TODO 语音信息识别成功,狗狗语音适配得分最高的跑过来
-    //        this.animator.SetBool("isListening", false);
-    //    }
-    //    else
-    //    {
-    //        this.animator.SetBool("isListening", false);
-    //    }
-
-    //    // TODO 根据返回结果设定focusdog
-    //    // focusdog 开启互动模式
-    //    HomeController.dogsInScene[GameData.focusDog].dogState = "interact";
-    //    HomeController.dogsInScene[GameData.focusDog].SetupInteract();
-    //}
-
     #endregion
 
     #region 喝水,吃食等道具消费函数

+ 26 - 18
Assets/Scripts/Home/HomeController.cs

@@ -266,7 +266,7 @@ public class HomeController : MonoBehaviour
                     else
                     {
                         // 暂时将其他非训练状态的狗game object隐藏
-                        dog.gameObject.SetActive(false);
+                        //dog.gameObject.SetActive(false);
                     }
                 }
             }
@@ -305,10 +305,10 @@ public class HomeController : MonoBehaviour
                 {
                     // 如果在eat drink进程结束前不执行随机场景代码
                     // 恢复因为交互,训练模式隐藏的狗
-                    if (dog.gameObject.activeSelf == false)
-                    {
-                        dog.gameObject.SetActive(true);
-                    }
+                    //if (dog.gameObject.activeSelf == false)
+                    //{
+                    //    dog.gameObject.SetActive(true);
+                    //}
                     if (dog.dogState == DogState.ITEM_CONSUME)
                     {
                         if (dog.isMovingToBowl)
@@ -553,7 +553,7 @@ public class HomeController : MonoBehaviour
                 }
             }
 
-            if (highestScore >= 0.6)        // 60分以上才可以进入交互模式
+            if (highestScore >= EnviromentSetting.voiceRecognitionScore)        // 60分以上才可以进入交互模式
             {
                 GameData.focusDog = UserProperty.GetDogIndexById(highestScoreDogId);
                 sceneMode = SceneMode.INACTIVE;       // 交互模式
@@ -569,15 +569,14 @@ public class HomeController : MonoBehaviour
                         // focusdog 开启互动模式
                         // HomeController.dogsInScene[GameData.focusDog].dogState = DogState.INTERACT;
                         HomeController.dogsInScene[GameData.focusDog].SetupInteract();
-                        // 其他狗进入隐藏模式
-                        foreach (var otherDog in dogsInScene)
-                        {
-                            if (otherDog.dogProperty.d_id != highestScoreDogId)
-                            {
-                                otherDog.gameObject.SetActive(false);
-                            }
-                        }
-                        // }
+                        // 其他狗进入隐藏模式(先保留代码)
+                        //foreach (var otherDog in dogsInScene)
+                        //{
+                        //    if (otherDog.dogProperty.d_id != highestScoreDogId)
+                        //    {
+                        //        otherDog.gameObject.SetActive(false);
+                        //    }
+                        //}
                     }
                 }
                 HomeSoundEffectController.Instance.PlaySoundEffect(5);
@@ -653,11 +652,20 @@ public class HomeController : MonoBehaviour
                         highestScoreCommand = score.Key;
                     }
                 }
+                // 根据狗的voiceCommand属性值修正得分。计算方式为狗的voiceCommand属性值/1000
+                highestScore += UserProperty.dogs[GameData.focusDog].voiceCommand / 1000f;
+                if (highestScore > 1)
+                {
+                    highestScore = 1;
+                }
+                Debug.Log("Highest score:" + highestScore.ToString());
+                Debug.Log("Highest command:" + highestScoreCommand);
+
                 dogsInScene[GameData.focusDog].ResetAnimationStatus();        // 重置狗的动画状态
-                if (highestScore >= 0.6f)
+                if (highestScore >= EnviromentSetting.voiceRecognitionScore)
                 {
                     string animationTrigger = highestScoreCommand.Substring(7);
-                    string animationBool = highestScoreCommand + "_status";
+                    string animationBool = animationTrigger + "_status";
                     var animator = dogsInScene[GameData.focusDog].gameObject.GetComponent<Animator>();
                     if (highestScoreCommand == "commandBark")
                     {
@@ -667,7 +675,7 @@ public class HomeController : MonoBehaviour
                     {
                         HomeSoundEffectController.Instance.PlaySoundEffect(5);
                     }
-                        animator.SetTrigger(animationTrigger);
+                    animator.SetTrigger(animationTrigger);
                     animator.SetBool(animationBool, true);
 
                     // 交互动画执行一段时间后停止

+ 3 - 3
Assets/Scripts/Login/SunMovement.cs

@@ -1,4 +1,4 @@
-using System.Collections;
+using System.Collections;
 using System.Collections.Generic;
 using Unity.VisualScripting;
 using UnityEditor.Experimental;
@@ -23,7 +23,7 @@ public class SunMovement : MonoBehaviour
         {
             // night time
             //rotateLight.color = new Color(0, 0, 0.5f, 1);
-            rotateLight.intensity = 0.45f;
+            rotateLight.intensity = 0.65f;
             rotateLight.spotAngle = 50;
             //rotateLight.type = LightType.Spot;
             rotateLight.transform.rotation  = Quaternion.Euler(50,180,0);
@@ -31,7 +31,7 @@ public class SunMovement : MonoBehaviour
             UnityEngine.RenderSettings.ambientIntensity = 0.3f;
             UnityEngine.RenderSettings.reflectionIntensity = 0.4f;
 
-            // ¹·¹·´´½¨µÆ¹â
+            // 狗狗创建�光
             var dogLight = GameObject.Find("Dog Light").GetComponent<Light>();
             dogLight.intensity = 1.2f;
         }

+ 8 - 0
Assets/Scripts/Test Scene.meta

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

Разлика између датотеке није приказан због своје велике величине
+ 11 - 0
Assets/Scripts/Test Scene/PlayerGestureController.cs


+ 2 - 0
Assets/Scripts/Test Scene/PlayerGestureController.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 47852a50d335dd9499f14d1d61b72f00

Неке датотеке нису приказане због велике количине промена