public virtual void ClimbEnd() { animator.SetBool(hashAnimator.climb, false); transform.position = new Vector3(Mathf.Round(transform.position.x), Mathf.Round(lastBlockTopClimb.transform.parent.position.y) + 1.5f, Mathf.Round(transform.position.z)); lastBlockTopClimb = null; NoAction(); }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == Tags.floor) { if (cubeTopColliding == null) { character.EndFalling(); } cubeTopColliding = other.gameObject.GetComponent <CubeTop> (); } }
public virtual void ClimbAction() { if (wallCheckDown.getCubeColliding() != null && lastBlockTopClimb == null) { if (wallCheckDown.getCubeColliding().GetHeight() == 1) { lastBlockTopClimb = wallCheckDown.getCubeColliding().cubeTop; } } if (lastBlockTopClimb != null && floorCheck.transform.position.y >= lastBlockTopClimb.transform.position.y) { ClimbEnd(); } }
void OnTriggerExit(Collider other) { if (other.gameObject.tag == Tags.floor) { if (cubeTopColliding == other.gameObject.GetComponent <CubeTop> ()) { cubeTopColliding = null; } } if (cubeTopColliding == null) { character.StartFalling(); } }