Esempio n. 1
0
    protected void physStayOnWall()
    {
        var rc = new UnderRaycaster(ref posture, ref figure, this);


        var res = new RaycastHit();

        if (rc.raycastUnder(out res))
        {
            // 接地してた

            posture.rot = Quaternion.FromToRotation(rc.up, res.normal) * posture.rot;

            rb.MovePosition(res.point);
        }
        else
        {
            // 落下へ

            state.setPhysics(physFree);
            shiftToPhysicalMode();
        }
    }
Esempio n. 2
0
 public bool raycastUnder(out RaycastHit hit)
 {
     return(r.raycastUnder(out hit));
 }