示例#1
0
    private void ClearOldVars()
    {
        _isRouteReady = false;

        if (_theRoute != null)
        {
            _theRoute.CheckPoints.Clear();
        }
        _theRoute = null;

        _cryRoute       = null;
        _cryBridgeRoute = null;
    }
示例#2
0
    private void WeHaveToCreateTheRoute()
    {
        //GameScene.print("We have to create new route " + _person.MyId + " o:" + OriginKey + " d:" + DestinyKey + " askT:" + _askDateTime);

        if (_one.LandZone != _two.LandZone)
        {
            //          //Debug.Log("Bridge Routing");
            _cryBridgeRoute = new CryBridgeRoute(_ini, _fin, _person, _destinyKey, _routeType);
        }
        else
        {
            //           //Debug.Log("Smple Routing");
            _cryRoute = new CryRoute(_ini, _fin, _person, _destinyKey, _iniDoor, _finDoor, _routeType);
        }
    }
示例#3
0
    /// <summary>
    /// Will tell u if intersect anyline at all
    ///
    /// will look only at the regions tht were pased in the 'histoRegions'
    ///
    /// Will evaluate Obstacle and TerraCrsyrstals
    /// </summary>
    /// <param name="line"></param>
    /// <param name="pos"></param>
    /// <returns></returns>
    public bool DoIIntersectAnyLine(Line line, List <int> histoRegions, CryRoute cryRoute)
    {
        var crystals = GiveAllCrystalsInTheseRegionsExcludLinkRects(histoRegions);

        for (int i = 0; i < crystals.Count; i++)
        {
            for (int j = 0; j < crystals[i].Lines.Count; j++)
            {
                var lineOnCrys = crystals[i].Lines[j];
                if (line.IsIntersecting((lineOnCrys)))
                {
                    //UVisHelp.CreateText(U2D.FromV2ToV3(lineOnCrys.A1), crystals[i].ParentId);

                    lineOnCrys.DebugRender(Color.red);
                    return(true);
                }
            }
        }
        return(false);
    }
示例#4
0
    public int CountLinesIIntersect(Line line, List <int> histoRegions, CryRoute cryRoute)
    {
        int res      = 0;
        var crystals = GiveAllCrystalsInTheseRegionsExcludLinkRects(histoRegions);

        for (int i = 0; i < crystals.Count; i++)
        {
            for (int j = 0; j < crystals[i].Lines.Count; j++)
            {
                var lineOnCrys = crystals[i].Lines[j];
                if (line.IsIntersecting((lineOnCrys)))
                {
                    //                   //Debug.Log("Intersected: " + crystals[i].ParentId + " tp: " +crystals[i].Type1);
                    Vector3 intersection = U2D.FromV2ToV3(line.FindIntersection(lineOnCrys));
                    //add key to explorer on the CryRoute
                    cryRoute.AddKeyToExplorer(crystals[i], intersection);

                    lineOnCrys.DebugRender(Color.black);
                    res++;
                }
            }
        }
        return(res);
    }
示例#5
0
 void SetTheRoute(TheRoute val)
 {
     _cryRoute          = new CryRoute();
     _cryRoute.TheRoute = val;
     _theRoute          = val;
 }