diff --git a/Assets/_PROJECT/Components/Bow/Scripts/ArcheryRange.cs b/Assets/_PROJECT/Components/Bow/Scripts/ArcheryRange.cs index 2498e898..0e319a43 100644 --- a/Assets/_PROJECT/Components/Bow/Scripts/ArcheryRange.cs +++ b/Assets/_PROJECT/Components/Bow/Scripts/ArcheryRange.cs @@ -87,8 +87,6 @@ public class ArcheryRange : NetworkBehaviour if (exitedPlayer == _scoredPlayer) keyboardManager.DeActivate(); // If the player īrefuses to enter their name. } - - public override void OnStopServer() { base.OnStopServer(); @@ -133,18 +131,18 @@ public class ArcheryRange : NetworkBehaviour private ArcheryTarget SpawnTarget(Vector3 randomPos) { - GameObject targetObject; - if (modelDisplay.Model == null) + // Spawn default UFO + GameObject targetObject = Instantiate(targetPrefab, randomPos, targetStartPosition.rotation, null); + if (modelDisplay.Model != null) { - // spawn default UFO - targetObject = Instantiate(targetPrefab, randomPos, Quaternion.identity, null); - } else - { - // spawn generated model - targetObject = Instantiate(modelDisplay.Model, randomPos, Quaternion.identity, null); - InitializeArcheryTargetObject(targetObject); + // Spawn generated object directly as default UFO's child + GameObject childObject = Instantiate(modelDisplay.Model); + childObject.transform.SetParent(targetObject.transform, false); + childObject.transform.localScale *= targetSizeIncrease; + + // Disable UFO's default body + targetObject.transform.Find("Body").gameObject.SetActive(false); } - targetObject.transform.rotation = targetStartPosition.rotation; ArcheryTarget target = targetObject.GetComponent(); target.endPosition = targetEndPosition.position; @@ -153,22 +151,6 @@ public class ArcheryRange : NetworkBehaviour return target; } - private void InitializeArcheryTargetObject(GameObject targetObject) - { - ArcheryTarget archeryTarget = targetObject.AddComponent(); - archeryTarget.pointsText = archeryTargetPointsText; - - Rigidbody rigidbody = targetObject.AddComponent(); - rigidbody.useGravity = false; - rigidbody.isKinematic = true; - - targetObject.AddComponent(); - targetObject.AddComponent(); - - targetObject.transform.localScale *= targetSizeIncrease; - } - - public void ResetRange() { if (!IsServer) return; diff --git a/Assets/_PROJECT/Prefabs/XR/Bow/TargetUFO.prefab b/Assets/_PROJECT/Prefabs/XR/Bow/TargetUFO.prefab index 44feff9b..9aef3d0c 100644 --- a/Assets/_PROJECT/Prefabs/XR/Bow/TargetUFO.prefab +++ b/Assets/_PROJECT/Prefabs/XR/Bow/TargetUFO.prefab @@ -9,9 +9,10 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3337587390139541606} - - component: {fileID: 627565954663756710} + - component: {fileID: 1081661767482416249} + - component: {fileID: 3779719438397915148} m_Layer: 0 - m_Name: SportModel + m_Name: Body m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -26,7 +27,7 @@ Transform: m_GameObject: {fileID: 3508152469845169189} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.24, y: 0.2, z: 0.2} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4011537191296717654} @@ -35,47 +36,50 @@ Transform: m_Father: {fileID: 7527508320363503049} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &627565954663756710 -MonoBehaviour: +--- !u!136 &1081661767482416249 +CapsuleCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3508152469845169189} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} - m_Name: - m_EditorClassIdentifier: - _componentIndexCache: 2 - _addedNetworkObject: {fileID: 2689384198849609103} - _networkObjectCache: {fileID: 2689384198849609103} - _synchronizeParent: 0 - _packing: - Position: 1 - Rotation: 1 - Scale: 0 - _interpolation: 2 - _extrapolation: 2 - _enableTeleport: 0 - _teleportThreshold: 1 - _clientAuthoritative: 1 - _sendToOwner: 1 - _synchronizePosition: 1 - _positionSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeRotation: 1 - _rotationSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeScale: 1 - _scaleSnapping: - X: 0 - Y: 0 - Z: 0 + serializedVersion: 2 + m_Radius: 1.07 + m_Height: 0.97 + m_Direction: 1 + m_Center: {x: 0.16, y: -0.51, z: 0} +--- !u!65 &3779719438397915148 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3508152469845169189} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 4.5, y: 0.5, z: 3.77} + m_Center: {x: 0.12, y: -0.24, z: 0.06} --- !u!1 &6744593628588765187 GameObject: m_ObjectHideFlags: 0 @@ -87,7 +91,6 @@ GameObject: - component: {fileID: 1251512755648678878} - component: {fileID: 4963625795242203983} - component: {fileID: 5457198189491340073} - - component: {fileID: 8959643074287331097} m_Layer: 0 m_Name: BezierCurve.007 m_TagString: Untagged @@ -102,13 +105,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6744593628588765187} - m_LocalRotation: {x: 0.00000031987892, y: 0, z: -0, w: 1} - m_LocalPosition: {x: 0.5, y: -1.2, z: 0.3} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalRotation: {x: 0.00000031987892, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.120000005, y: -0.24000001, z: 0.06000042} + m_LocalScale: {x: 0.24, y: 0.2, z: 0.2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3337587390139541606} - m_RootOrder: 2 + m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &4963625795242203983 MeshFilter: @@ -161,47 +164,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!114 &8959643074287331097 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6744593628588765187} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} - m_Name: - m_EditorClassIdentifier: - _componentIndexCache: 5 - _addedNetworkObject: {fileID: 2689384198849609103} - _networkObjectCache: {fileID: 2689384198849609103} - _synchronizeParent: 0 - _packing: - Position: 1 - Rotation: 1 - Scale: 0 - _interpolation: 2 - _extrapolation: 2 - _enableTeleport: 0 - _teleportThreshold: 1 - _clientAuthoritative: 1 - _sendToOwner: 1 - _synchronizePosition: 1 - _positionSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeRotation: 1 - _rotationSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeScale: 1 - _scaleSnapping: - X: 0 - Y: 0 - Z: 0 --- !u!1 &7680366769166628765 GameObject: m_ObjectHideFlags: 0 @@ -213,7 +175,6 @@ GameObject: - component: {fileID: 4011537191296717654} - component: {fileID: 1910778184414920112} - component: {fileID: 363608006073787400} - - component: {fileID: 4439869206153374580} m_Layer: 0 m_Name: BezierCurve.005 m_TagString: Untagged @@ -228,13 +189,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7680366769166628765} - m_LocalRotation: {x: 0.00000031987892, y: 0, z: -0, w: 1} - m_LocalPosition: {x: 0.5, y: 0.3, z: 0.3} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalRotation: {x: 0.00000031987892, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.120000005, y: 0.060000062, z: 0.06000042} + m_LocalScale: {x: 0.24, y: 0.2, z: 0.2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3337587390139541606} - m_RootOrder: 0 + m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &1910778184414920112 MeshFilter: @@ -286,47 +247,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!114 &4439869206153374580 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7680366769166628765} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} - m_Name: - m_EditorClassIdentifier: - _componentIndexCache: 3 - _addedNetworkObject: {fileID: 2689384198849609103} - _networkObjectCache: {fileID: 2689384198849609103} - _synchronizeParent: 0 - _packing: - Position: 1 - Rotation: 1 - Scale: 0 - _interpolation: 2 - _extrapolation: 2 - _enableTeleport: 0 - _teleportThreshold: 1 - _clientAuthoritative: 1 - _sendToOwner: 1 - _synchronizePosition: 1 - _positionSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeRotation: 1 - _rotationSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeScale: 1 - _scaleSnapping: - X: 0 - Y: 0 - Z: 0 --- !u!1 &7983999977322064054 GameObject: m_ObjectHideFlags: 0 @@ -340,8 +260,6 @@ GameObject: - component: {fileID: 8954823527229761837} - component: {fileID: 2689384198849609103} - component: {fileID: 1843883317757509263} - - component: {fileID: 7451921017238644471} - - component: {fileID: 2131608416831220487} m_Layer: 0 m_Name: TargetUFO m_TagString: Untagged @@ -357,7 +275,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7983999977322064054} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.398, y: 1.1, z: 8.292} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -429,10 +347,6 @@ MonoBehaviour: _networkBehaviours: - {fileID: 4850307641519017041} - {fileID: 1843883317757509263} - - {fileID: 627565954663756710} - - {fileID: 4439869206153374580} - - {fileID: 6540522042633253623} - - {fileID: 8959643074287331097} k__BackingField: {fileID: 0} k__BackingField: [] _isNetworked: 1 @@ -487,50 +401,6 @@ MonoBehaviour: X: 0 Y: 0 Z: 0 ---- !u!136 &7451921017238644471 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7983999977322064054} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 1.07 - m_Height: 0.97 - m_Direction: 1 - m_Center: {x: 0.16, y: -0.51, z: 0} ---- !u!65 &2131608416831220487 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7983999977322064054} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 4.5, y: 0.5, z: 3.77} - m_Center: {x: 0.12, y: -0.24, z: 0.06} --- !u!1 &8462201784916155029 GameObject: m_ObjectHideFlags: 0 @@ -542,7 +412,6 @@ GameObject: - component: {fileID: 2406214921254263651} - component: {fileID: 6767210086105080178} - component: {fileID: 3766991064380355318} - - component: {fileID: 6540522042633253623} m_Layer: 0 m_Name: BezierCurve.006 m_TagString: Untagged @@ -558,12 +427,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8462201784916155029} m_LocalRotation: {x: -0.00000015993946, y: 0.86602545, z: -0.00000027702328, w: -0.49999997} - m_LocalPosition: {x: 0.5, y: -3.4, z: 0.3} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0.121, y: -0.663, z: 0.072} + m_LocalScale: {x: 0.22, y: 0.2, z: 0.24} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3337587390139541606} - m_RootOrder: 1 + m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &6767210086105080178 MeshFilter: @@ -615,44 +484,3 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!114 &6540522042633253623 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8462201784916155029} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} - m_Name: - m_EditorClassIdentifier: - _componentIndexCache: 4 - _addedNetworkObject: {fileID: 2689384198849609103} - _networkObjectCache: {fileID: 2689384198849609103} - _synchronizeParent: 0 - _packing: - Position: 1 - Rotation: 1 - Scale: 0 - _interpolation: 2 - _extrapolation: 2 - _enableTeleport: 0 - _teleportThreshold: 1 - _clientAuthoritative: 1 - _sendToOwner: 1 - _synchronizePosition: 1 - _positionSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeRotation: 1 - _rotationSnapping: - X: 0 - Y: 0 - Z: 0 - _synchronizeScale: 1 - _scaleSnapping: - X: 0 - Y: 0 - Z: 0 diff --git a/config.json b/config.json index 61ce2a78..fa52880e 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "isContinuousLocomotion": true, "continuousLocomotionSpeed": 3.0, - "volumeMaster": 0.5969846844673157, + "volumeMaster": 0.4399948716163635, "volumeAmbient": 0.1889490932226181, "volumeMusic": 0.5, "volumeSFX": 0.5,