示例#1
0
        public IMyPath FindPathGlobal(Vector3D begin, IMyDestinationShape end, MyEntity entity = null)
        {
            if (!MyPerGameSettings.EnablePathfinding)
            {
                return(null);
            }
            MySmartGoal goal  = new MySmartGoal(end, entity);
            MySmartPath path1 = new MySmartPath(this);

            path1.Init(begin, goal);
            return(path1);
        }
示例#2
0
        public MySmartPath FindPathGlobal(Vector3D begin, IMyDestinationShape end, MyEntity entity = null)
        {
            Debug.Assert(MyPerGameSettings.EnablePathfinding, "Pathfinding is not enabled!");
            if (!MyPerGameSettings.EnablePathfinding)
            {
                return(null);
            }

            ProfilerShort.Begin("MyPathfinding.FindPathGlobal");

            // CH: TODO: Use pooling
            MySmartPath newPath = new MySmartPath(this);
            MySmartGoal newGoal = new MySmartGoal(end, entity);

            newPath.Init(begin, newGoal);

            ProfilerShort.End();
            return(newPath);
        }