From 0039160c60a40565cde290a8f90820cf63779e58 Mon Sep 17 00:00:00 2001 From: haitem Date: Sat, 29 Jan 2022 17:23:26 +0100 Subject: [PATCH] Edit visual of playerControler --- Assets/Scenes/Haitem.unity | 12 ++++++------ Assets/Scripts/PlayerController.cs | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Assets/Scenes/Haitem.unity b/Assets/Scenes/Haitem.unity index 7486337..902035e 100644 --- a/Assets/Scenes/Haitem.unity +++ b/Assets/Scenes/Haitem.unity @@ -123,6 +123,11 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &80285248 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3244356566819001084, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} + m_PrefabInstance: {fileID: 9031117423312889080} + m_PrefabAsset: {fileID: 0} --- !u!1 &447415686 GameObject: m_ObjectHideFlags: 0 @@ -253,7 +258,7 @@ MonoBehaviour: - {fileID: 8768991388683709947, guid: 1e3f34788e0cb3f49a0bef285d5b059a, type: 3} - {fileID: 8768991388683709947, guid: 97d4c453fb5affa448968cb5ce9ca2f4, type: 3} - {fileID: 7678802340880963262, guid: c7b1510ab2ab8e349bfaafa501cecb1f, type: 3} - player: {fileID: 9031117423312889081} + player: {fileID: 80285248} --- !u!4 &1643205526 Transform: m_ObjectHideFlags: 0 @@ -334,8 +339,3 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} ---- !u!1 &9031117423312889081 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3244356567786994344, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} - m_PrefabInstance: {fileID: 9031117423312889080} - m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index adaa771..73b2d7b 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -4,28 +4,32 @@ using UnityEngine; public class PlayerController : MonoBehaviour { + [Header("Move")] public float speed = 7.5f; public float maxSpeed = 15.0f; public float minSpeed = 5.0f; [HideInInspector] public float currentSpeed = 0f; private float modifier = 0.0f; - public float jumpSpeed = 7.5f; - public float lookSpeed = 7.5f; - public float lookXLimit = 40.0f; - public Camera playerCamera; - public ParticleSystem runningParticles; Vector3 moveDirection = Vector3.zero; - public float rotationX = 0; - public Transform mainObject; - // Start is called before the first frame update - [HideInInspector] bool canMove = true; Rigidbody rb; float moveDirectionY; + public bool isRunning = false; + [Header("Jump")] + public float jumpSpeed = 7.5f; + [HideInInspector] public bool jump = false; private bool isGrounded = false; - public bool isRunning = false; + [Header("Camera")] + public float lookSpeed = 7.5f; + public float lookXLimit = 40.0f; + public Camera playerCamera; + public float rotationX = 0; + [Header("Others")] + public ParticleSystem runningParticles; + public Transform mainObject; + // Start is called before the first frame update private Vector3 saveDirection; private Vector3 downDirection;