using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Rigging.Data { public class StandingDataHandler : RiggingDataBase { public float sinceGrounded; // ÀëµØÊ±¼ä public float sinceLanded; public bool isGrounded; public float distanceToGround = 1f; private bool hasRecievedTouchedGround; private MovementDataHandler movementData; protected override void OnStart() { movementData = player.status.movementData; } protected override void OnFixedUpdate() { sinceGrounded += Time.fixedDeltaTime; sinceLanded += Time.fixedDeltaTime; if ((double)sinceGrounded > 0.1) { isGrounded = false; } } protected override void OnLateUpdate() { hasRecievedTouchedGround = false; } public void TouchGround(float distance, Vector3 normal) { //if (sinceGrounded > 0.5f && (bool)wobbleShake) //{ // wobbleShake.AddShake(-Vector3.up * 5f * Mathf.Pow(sinceGrounded, 1.5f), 0.8f); //} if (sinceGrounded > 0.5f) { Land(sinceGrounded); } sinceGrounded = 0f; isGrounded = true; if (distance > distanceToGround || !hasRecievedTouchedGround) { distanceToGround = distance; } hasRecievedTouchedGround = true; //moveMentData.SetSlope(normal); } private void Land(float landForce) { sinceLanded = 0f; } } }