From ba088f7a7b7bb08e9a2f9396a50ad277cd1144b6 Mon Sep 17 00:00:00 2001 From: Ken Schaefer Date: Thu, 16 Jan 2020 10:58:17 -0600 Subject: [PATCH] Refactored the player movement script --- .../Scripts/PlayerMovement.cs | 99 ++++++++++--------- .../Variables/GravityEarth.asset | 16 +++ .../Variables/GravityEarth.asset.meta | 8 ++ .../Variables/GravityEarthMoon.asset | 16 +++ .../Variables/GravityEarthMoon.asset.meta | 8 ++ .../Variables/GravityJupiter.asset | 16 +++ .../Variables/GravityJupiter.asset.meta | 8 ++ .../Variables/GravityMars.asset | 16 +++ .../Variables/GravityMars.asset.meta | 8 ++ .../Variables/GravityMercury.asset | 16 +++ .../Variables/GravityMercury.asset.meta | 8 ++ .../Variables/GravityNeptune.asset | 16 +++ .../Variables/GravityNeptune.asset.meta | 8 ++ .../Variables/GravityPluto.asset | 16 +++ .../Variables/GravityPluto.asset.meta | 8 ++ .../Variables/GravitySaturn.asset | 16 +++ .../Variables/GravitySaturn.asset.meta | 8 ++ .../Variables/GravityUranus.asset | 16 +++ .../Variables/GravityUranus.asset.meta | 8 ++ .../Variables/GravityVenus.asset | 16 +++ .../Variables/GravityVenus.asset.meta | 8 ++ .../Variables/PlayerJumpHeight.asset | 16 +++ .../Variables/PlayerJumpHeight.asset.meta | 8 ++ .../Variables/PlayerSpeed.asset | 16 +++ .../Variables/PlayerSpeed.asset.meta | 8 ++ Assets/Scenes/SampleScene.unity | 65 +++++++++++- ProjectSettings/QualitySettings.asset | 33 +++---- ProjectSettings/UnityConnectSettings.asset | 2 +- 28 files changed, 420 insertions(+), 67 deletions(-) create mode 100644 Assets/FirstPersonController/Variables/GravityEarth.asset create mode 100644 Assets/FirstPersonController/Variables/GravityEarth.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityEarthMoon.asset create mode 100644 Assets/FirstPersonController/Variables/GravityEarthMoon.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityJupiter.asset create mode 100644 Assets/FirstPersonController/Variables/GravityJupiter.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityMars.asset create mode 100644 Assets/FirstPersonController/Variables/GravityMars.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityMercury.asset create mode 100644 Assets/FirstPersonController/Variables/GravityMercury.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityNeptune.asset create mode 100644 Assets/FirstPersonController/Variables/GravityNeptune.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityPluto.asset create mode 100644 Assets/FirstPersonController/Variables/GravityPluto.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravitySaturn.asset create mode 100644 Assets/FirstPersonController/Variables/GravitySaturn.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityUranus.asset create mode 100644 Assets/FirstPersonController/Variables/GravityUranus.asset.meta create mode 100644 Assets/FirstPersonController/Variables/GravityVenus.asset create mode 100644 Assets/FirstPersonController/Variables/GravityVenus.asset.meta create mode 100644 Assets/FirstPersonController/Variables/PlayerJumpHeight.asset create mode 100644 Assets/FirstPersonController/Variables/PlayerJumpHeight.asset.meta create mode 100644 Assets/FirstPersonController/Variables/PlayerSpeed.asset create mode 100644 Assets/FirstPersonController/Variables/PlayerSpeed.asset.meta diff --git a/Assets/FirstPersonController/Scripts/PlayerMovement.cs b/Assets/FirstPersonController/Scripts/PlayerMovement.cs index 40424ce..8e5c016 100644 --- a/Assets/FirstPersonController/Scripts/PlayerMovement.cs +++ b/Assets/FirstPersonController/Scripts/PlayerMovement.cs @@ -1,56 +1,65 @@ /****************************************************************************** * Initial code based on Brackey's FPS video * https://youtu.be/_QajrabyTJc + * + * Notes: + * Refactored public fields to [SerializeField]. + * + * Refactored player and environment attributes to use Float References. This + * will allow other objects to buff/debuff these settings. + *****************************************************************************/ + +/****************************************************************************** + * *****************************************************************************/ using System.Collections; using System.Collections.Generic; +using Architecture.Variables; using UnityEngine; public class PlayerMovement : MonoBehaviour { - // Implement movement - public CharacterController controller; - public float speed = 12f; - - // Implement gravity - public float gravity = -9.81f; - private Vector3 velocity; - - // Implement ground reset of gravity - public Transform groundCheck; - public float groundDistance = 0.4f; - public LayerMask groundMask; - private bool isGrounded; - - // Implement jumping - public float jumpHeight = 3f; - - void Update() - { - // Check if the player is on the ground and reset gravity - isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask); - Debug.Log(isGrounded); - if (isGrounded && velocity.y < 0) - { - velocity.y = -2f; - } - - // Implement movement - float x = Input.GetAxis("Horizontal"); - float z = Input.GetAxis("Vertical"); - - Vector3 move = transform.right * x + transform.forward * z; - controller.Move(move * speed * Time.deltaTime); - - // Implement jumping - if(Input.GetButtonDown("Jump") && isGrounded) - { - Debug.Log("Jumping"); - velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity); - } - - // Implement gravity - velocity.y += gravity * Time.deltaTime; - controller.Move(velocity * Time.deltaTime); - } + [Header("Character")] + [SerializeField] private CharacterController controller; + + [Header("Attributes")] + [SerializeField] private FloatReference playerSpeed; + [SerializeField] private FloatReference jumpHeight; + + [Header("Environment")] + [SerializeField] private FloatReference gravity; + private Vector3 velocity; + + [Header("Ground")] + [SerializeField] private Transform groundCheck; + [SerializeField] private float groundDistance = 0.4f; + [SerializeField] private LayerMask groundMask; + private bool isGrounded; + + void Update() + { + // Check if the player is on the ground and reset gravity + isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask); + if (isGrounded && velocity.y < 0) + { + velocity.y = -2f; + } + + // Implement movement + float x = Input.GetAxis("Horizontal"); + float z = Input.GetAxis("Vertical"); + + Vector3 move = transform.right * x + transform.forward * z; + controller.Move(move * playerSpeed.Value * Time.deltaTime); + + // Implement jumping + if(Input.GetButtonDown("Jump") && isGrounded) + { + velocity.y = Mathf.Sqrt(jumpHeight.Value * -2f * gravity.Value); + } + + // Implement gravity + velocity.y += gravity.Value * Time.deltaTime; + controller.Move(velocity * Time.deltaTime); + } } diff --git a/Assets/FirstPersonController/Variables/GravityEarth.asset b/Assets/FirstPersonController/Variables/GravityEarth.asset new file mode 100644 index 0000000..da5843d --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityEarth.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityEarth + m_EditorClassIdentifier: + DeveloperDescription: + Value: -9.8 diff --git a/Assets/FirstPersonController/Variables/GravityEarth.asset.meta b/Assets/FirstPersonController/Variables/GravityEarth.asset.meta new file mode 100644 index 0000000..f3aa04d --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityEarth.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc418284fb9af5f46b601970ea5d2868 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityEarthMoon.asset b/Assets/FirstPersonController/Variables/GravityEarthMoon.asset new file mode 100644 index 0000000..ad62ddb --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityEarthMoon.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityEarthMoon + m_EditorClassIdentifier: + DeveloperDescription: + Value: -1.6 diff --git a/Assets/FirstPersonController/Variables/GravityEarthMoon.asset.meta b/Assets/FirstPersonController/Variables/GravityEarthMoon.asset.meta new file mode 100644 index 0000000..e255a2d --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityEarthMoon.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba6e18959c9b91d49bbb2b9897c0dd09 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityJupiter.asset b/Assets/FirstPersonController/Variables/GravityJupiter.asset new file mode 100644 index 0000000..0819695 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityJupiter.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityJupiter + m_EditorClassIdentifier: + DeveloperDescription: + Value: -24.9 diff --git a/Assets/FirstPersonController/Variables/GravityJupiter.asset.meta b/Assets/FirstPersonController/Variables/GravityJupiter.asset.meta new file mode 100644 index 0000000..838c324 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityJupiter.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89639fdc61d4c234cb28f16bfde630f8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityMars.asset b/Assets/FirstPersonController/Variables/GravityMars.asset new file mode 100644 index 0000000..626d5d4 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityMars.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityMars + m_EditorClassIdentifier: + DeveloperDescription: + Value: -3.8 diff --git a/Assets/FirstPersonController/Variables/GravityMars.asset.meta b/Assets/FirstPersonController/Variables/GravityMars.asset.meta new file mode 100644 index 0000000..e71b976 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityMars.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee3bf6f48ab93234cae8dd115088d905 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityMercury.asset b/Assets/FirstPersonController/Variables/GravityMercury.asset new file mode 100644 index 0000000..c4ede4b --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityMercury.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityMercury + m_EditorClassIdentifier: + DeveloperDescription: + Value: -3.7 diff --git a/Assets/FirstPersonController/Variables/GravityMercury.asset.meta b/Assets/FirstPersonController/Variables/GravityMercury.asset.meta new file mode 100644 index 0000000..11380e7 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityMercury.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3ef7ce93616e5e4ca66c56056fe9bbd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityNeptune.asset b/Assets/FirstPersonController/Variables/GravityNeptune.asset new file mode 100644 index 0000000..2e9e2a0 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityNeptune.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityNeptune + m_EditorClassIdentifier: + DeveloperDescription: + Value: -11.2 diff --git a/Assets/FirstPersonController/Variables/GravityNeptune.asset.meta b/Assets/FirstPersonController/Variables/GravityNeptune.asset.meta new file mode 100644 index 0000000..ece90bc --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityNeptune.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c576e6a04afe7442b63e95b18254591 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityPluto.asset b/Assets/FirstPersonController/Variables/GravityPluto.asset new file mode 100644 index 0000000..7b0f6e1 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityPluto.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityPluto + m_EditorClassIdentifier: + DeveloperDescription: + Value: -0.5 diff --git a/Assets/FirstPersonController/Variables/GravityPluto.asset.meta b/Assets/FirstPersonController/Variables/GravityPluto.asset.meta new file mode 100644 index 0000000..c83c3bd --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityPluto.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 43af1b2fd533f45468473cc4650723cc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravitySaturn.asset b/Assets/FirstPersonController/Variables/GravitySaturn.asset new file mode 100644 index 0000000..656be13 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravitySaturn.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravitySaturn + m_EditorClassIdentifier: + DeveloperDescription: + Value: -10.5 diff --git a/Assets/FirstPersonController/Variables/GravitySaturn.asset.meta b/Assets/FirstPersonController/Variables/GravitySaturn.asset.meta new file mode 100644 index 0000000..823fb4e --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravitySaturn.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94ef2828596b707489700edf1e5d8256 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityUranus.asset b/Assets/FirstPersonController/Variables/GravityUranus.asset new file mode 100644 index 0000000..9965ad9 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityUranus.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityUranus + m_EditorClassIdentifier: + DeveloperDescription: + Value: -8.8 diff --git a/Assets/FirstPersonController/Variables/GravityUranus.asset.meta b/Assets/FirstPersonController/Variables/GravityUranus.asset.meta new file mode 100644 index 0000000..bab0450 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityUranus.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51b4aa3df13827e42847b0803269b0af +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/GravityVenus.asset b/Assets/FirstPersonController/Variables/GravityVenus.asset new file mode 100644 index 0000000..dc28f53 --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityVenus.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: GravityVenus + m_EditorClassIdentifier: + DeveloperDescription: + Value: -8.8 diff --git a/Assets/FirstPersonController/Variables/GravityVenus.asset.meta b/Assets/FirstPersonController/Variables/GravityVenus.asset.meta new file mode 100644 index 0000000..0774bab --- /dev/null +++ b/Assets/FirstPersonController/Variables/GravityVenus.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13fabc8ac191ddd4ca3971038b460d86 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/PlayerJumpHeight.asset b/Assets/FirstPersonController/Variables/PlayerJumpHeight.asset new file mode 100644 index 0000000..46962f9 --- /dev/null +++ b/Assets/FirstPersonController/Variables/PlayerJumpHeight.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: PlayerJumpHeight + m_EditorClassIdentifier: + DeveloperDescription: + Value: 3 diff --git a/Assets/FirstPersonController/Variables/PlayerJumpHeight.asset.meta b/Assets/FirstPersonController/Variables/PlayerJumpHeight.asset.meta new file mode 100644 index 0000000..fc73d3e --- /dev/null +++ b/Assets/FirstPersonController/Variables/PlayerJumpHeight.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54e5f8576430e8b4c9d8162f5505b836 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FirstPersonController/Variables/PlayerSpeed.asset b/Assets/FirstPersonController/Variables/PlayerSpeed.asset new file mode 100644 index 0000000..a854056 --- /dev/null +++ b/Assets/FirstPersonController/Variables/PlayerSpeed.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7cb18c6bb3c4bcd40b8451100e11b136, type: 3} + m_Name: PlayerSpeed + m_EditorClassIdentifier: + DeveloperDescription: + Value: 12 diff --git a/Assets/FirstPersonController/Variables/PlayerSpeed.asset.meta b/Assets/FirstPersonController/Variables/PlayerSpeed.asset.meta new file mode 100644 index 0000000..49a72ac --- /dev/null +++ b/Assets/FirstPersonController/Variables/PlayerSpeed.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 83bee3e171c362344adb248477e4d1ef +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 0a2d6f5..9f2c83e 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -193,7 +193,41 @@ PrefabInstance: propertyPath: m_LocalPosition.y value: -1 objectReference: {fileID: 0} - m_RemovedComponents: [] + - target: {fileID: 3550138640128765045, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + propertyPath: speed.UseConstant + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3550138640128765045, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + propertyPath: speed.Variable + value: + objectReference: {fileID: 11400000, guid: 83bee3e171c362344adb248477e4d1ef, + type: 2} + - target: {fileID: 3550138640128765045, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + propertyPath: playerSpeed.UseConstant + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3550138640128765045, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + propertyPath: playerSpeed.Variable + value: + objectReference: {fileID: 11400000, guid: 83bee3e171c362344adb248477e4d1ef, + type: 2} + - target: {fileID: 3550138640128765045, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + propertyPath: jumpHeight.UseConstant + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3550138640128765045, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + propertyPath: jumpHeight.Variable + value: + objectReference: {fileID: 11400000, guid: 54e5f8576430e8b4c9d8162f5505b836, + type: 2} + m_RemovedComponents: + - {fileID: 3550138641603433537, guid: 9854b5f248050394d812af81aea24c85, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 9854b5f248050394d812af81aea24c85, type: 3} --- !u!43 &293473666 Mesh: @@ -1540,6 +1574,35 @@ Transform: m_Father: {fileID: 1581365604} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1367914313 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3550138641603433536, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + m_PrefabInstance: {fileID: 101267523} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1548272746 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3550138640128765042, guid: 9854b5f248050394d812af81aea24c85, + type: 3} + m_PrefabInstance: {fileID: 101267523} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1548272747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1548272746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ab706c0b91713f41aeb632f1070ae9c, type: 3} + m_Name: + m_EditorClassIdentifier: + mouseSensitivity: + UseConstant: 0 + ConstantValue: 0 + Variable: {fileID: 11400000, guid: 32c605729eb4c1246bcc95c94a8608e4, type: 2} + mainCamera: {fileID: 1367914313} --- !u!1 &1581365603 GameObject: m_ObjectHideFlags: 0 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 7b7658d..8f6169f 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -18,7 +18,7 @@ QualitySettings: shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowmaskMode: 0 - blendWeights: 1 + skinWeights: 1 textureQuality: 1 anisotropicTextures: 0 antiAliasing: 0 @@ -40,6 +40,7 @@ QualitySettings: asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - serializedVersion: 2 name: Low @@ -53,7 +54,7 @@ QualitySettings: shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowmaskMode: 0 - blendWeights: 2 + skinWeights: 2 textureQuality: 0 anisotropicTextures: 0 antiAliasing: 0 @@ -75,6 +76,7 @@ QualitySettings: asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - serializedVersion: 2 name: Medium @@ -88,7 +90,7 @@ QualitySettings: shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowmaskMode: 0 - blendWeights: 2 + skinWeights: 2 textureQuality: 0 anisotropicTextures: 1 antiAliasing: 0 @@ -110,6 +112,7 @@ QualitySettings: asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - serializedVersion: 2 name: High @@ -123,7 +126,7 @@ QualitySettings: shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowmaskMode: 1 - blendWeights: 2 + skinWeights: 2 textureQuality: 0 anisotropicTextures: 1 antiAliasing: 0 @@ -145,6 +148,7 @@ QualitySettings: asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - serializedVersion: 2 name: Very High @@ -158,7 +162,7 @@ QualitySettings: shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowmaskMode: 1 - blendWeights: 4 + skinWeights: 4 textureQuality: 0 anisotropicTextures: 2 antiAliasing: 2 @@ -180,6 +184,7 @@ QualitySettings: asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - serializedVersion: 2 name: Ultra @@ -193,7 +198,7 @@ QualitySettings: shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowmaskMode: 1 - blendWeights: 4 + skinWeights: 4 textureQuality: 0 anisotropicTextures: 2 antiAliasing: 2 @@ -215,18 +220,6 @@ QualitySettings: asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 2 - Lumin: 5 - Nintendo 3DS: 5 - Nintendo Switch: 5 - PS4: 5 - PSP2: 2 - Stadia: 5 - Standalone: 5 - WebGL: 3 - Windows Store Apps: 5 - XboxOne: 5 - iPhone: 2 - tvOS: 2 + m_PerPlatformDefaultQuality: {} diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset index fa0b146..c3ae9a0 100644 --- a/ProjectSettings/UnityConnectSettings.asset +++ b/ProjectSettings/UnityConnectSettings.asset @@ -4,7 +4,7 @@ UnityConnectSettings: m_ObjectHideFlags: 0 serializedVersion: 1 - m_Enabled: 0 + m_Enabled: 1 m_TestMode: 0 m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events m_EventUrl: https://cdp.cloud.unity3d.com/v1/events