예제 #1
0
    public bool WallStand(ClientSideObject target)
    {
        Vector3    origin = new Vector3(GetXPos(), 0.5f, GetZPos());
        Vector3    goal   = new Vector3(target.GetXPos(), 0.5f, target.GetZPos());
        Ray        ray    = new Ray(origin, goal - origin);
        RaycastHit hit;

        return(Physics.Raycast(ray, out hit, Vector3.Distance(goal, origin), wallLayerMask));
    }
예제 #2
0
 public float Distance(ClientSideObject target)
 {
     return(Vector2.Distance(new Vector2(target.GetXPos(), target.GetZPos()), new Vector2(this.GetXPos(), this.GetZPos()))
            - target.GetRadius() - this.GetRadius());
 }