示例#1
0
    public float DistanceBetween = 0.0f;        // Distance between the car and APoint

    // Start is called before the first frame update
    void Start()
    {
        Debug.Assert(APoint != null);       // Make sure proper editor setup
        Debug.Assert(TheCar != null);

        SphereBound = new MySphereBound();  // To visualize the sphere bound
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Assert(TheTaxi != null);      // Make sure proper editor setup
        Debug.Assert(TheCar != null);

        TaxiBound = new MySphereBound();
        CarBound  = new MySphereBound();
    }
示例#3
0
    //  Returns if there is an intersection with anotherSphere
    public bool SpheresIntersects(MySphereBound anotherSphere)
    {
        Vector3 diff = this.Center - anotherSphere.Center;

        return(diff.magnitude <= (this.Radius + anotherSphere.Radius));
    }