示例#1
0
文件: RouterManager.cs 项目: Cdrix/SM
    void WeHaveToCreateTheRoute()
    {
        //GameScene.print("Brand new route ");

        //if is not water
        if (!IsWaterOrMountainBtw(_ini.SpawnPoint.transform.position, _fin.SpawnPoint.transform.position))
        {
            //GameScene.print("Init() not water");
            _router = new Router(_ini.SpawnPoint.transform.position, _fin.SpawnPoint.transform.position, _person,
                                 _iniBehind, _finBehind, _ini.MyId, _fin.MyId);
        }
        else
        {    //try delta routing,//other wise will try bridge router, //other wise black list the building
            _iAmDeltaRouting = true;
            if (!_useIniBehind && !_useFinBehind)
            {
                _deltaCapsule = new DeltaCapsule(_ini, _fin, _person);
            }
            else
            {
                _deltaCapsule = new DeltaCapsule(_ini.SpawnPoint.transform.position, _fin.SpawnPoint.transform.position,
                                                 _person, _iniBehind, _finBehind);
            }
        }
    }
示例#2
0
文件: CanIReach.cs 项目: Cdrix/SM
    /// <summary>
    /// Conform valid result and passes the DeltaCapsule too
    /// </summary>
    /// <param name="from"></param>
    /// <param name="to">the end from the bridge , the bottom </param>
    /// <param name="deltaCapsule"></param>
    void ConformValidResult(Vector3 from, Vector3 to, DeltaCapsule deltaCapsule)
    {
        Vector3[] f4Points = new Vector3[4] {
            _endABot, _endATop, _endBTop, _endBBot
        };

        _reachBean = new ReachBean(from, f4Points, deltaCapsule, _person, _inverse);
        Restart();
    }
示例#3
0
文件: CanIReach.cs 项目: Cdrix/SM
 public void CleanBean()
 {
     _isReacheable = false;
     _result       = -5;
     _validFrom    = new Vector3();
     _validToBot   = new Vector3();
     _deltaCapsule = new DeltaCapsule();
     _router       = new Router();
     _theRoute     = new TheRoute();
 }
示例#4
0
文件: CanIReach.cs 项目: Cdrix/SM
 public ReachBean(Vector3 from, Vector3[] f4Points, DeltaCapsule deltaCapsule, Person person, bool inverse)
 {
     _validFrom    = from;
     _validToBot   = f4Points[0];
     _validToTop   = f4Points[1];
     _isReacheable = true;
     _keepResult   = 1;
     _f4Points     = f4Points;
     _person       = person;
     _inverse      = inverse;
     _deltaCapsule = deltaCapsule;
     ConformFinalRoute(_deltaCapsule.FinalRouter.TheRoute.CheckPoints);
 }
示例#5
0
文件: CanIReach.cs 项目: Cdrix/SM
    void TryDeltaRoute(Vector3 fromP, Vector3 toP)
    {
        InvertIfNeeded(ref fromP, ref toP, _inverse);

        _deltaCapsule = new DeltaCapsule(fromP, toP, _person);
    }