Beispiel #1
0
 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();
 }
Beispiel #2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == Tags.floor)
     {
         if (cubeTopColliding == null)
         {
             character.EndFalling();
         }
         cubeTopColliding = other.gameObject.GetComponent <CubeTop> ();
     }
 }
Beispiel #3
0
 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();
     }
 }
Beispiel #4
0
    void OnTriggerExit(Collider other)
    {
        if (other.gameObject.tag == Tags.floor)
        {
            if (cubeTopColliding == other.gameObject.GetComponent <CubeTop> ())
            {
                cubeTopColliding = null;
            }
        }

        if (cubeTopColliding == null)
        {
            character.StartFalling();
        }
    }