private void UpdateOnPlaneWhenExit(Collider other) { MonoPlane plane = other.GetComponent <MonoPlane>(); if (plane != null) { onPlane = null; } }
private void UpdateOnPlaneWhenStay(Collider other) { onPlane = other.GetComponent <MonoPlane>(); }
//void CorrectPosition(bool isColliding, Vector3 hitPoint, MonoPlane plane) //{ // if (isColliding == false) // return; // Vector3 correctedPosition = plane.CorrectedPosition(this); // Debug.DrawLine(hitPoint, correctedPosition, Color.green); // transform.position = correctedPosition; //} /// <summary> /// Assuming the initial velocity is 0 /// </summary> /// <returns></returns> public float VelocityOnGround(MonoPlane plane) { return(Mathf.Sqrt(2f * Physics.gravity.magnitude * (transform.position.y - plane.transform.position.y))); }