Пример #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());
 }