本文整理汇总了C#中AstarPath.Scan方法的典型用法代码示例。如果您正苦于以下问题:C# AstarPath.Scan方法的具体用法?C# AstarPath.Scan怎么用?C# AstarPath.Scan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AstarPath
的用法示例。
在下文中一共展示了AstarPath.Scan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUpPathFinding
private void SetUpPathFinding()
{
//pfGo = GameObject.Find("PathFinding");
pf = this.GetComponent<AstarPath>();
//set path finding region to the center of building
Vector3 center = HoUtility.GetCenterOfGroup(mainObject);
Debug.Log ("Center point: " + center);
pf.transform.position = new Vector3(center.x,0F,center.z);
ground.transform.position = new Vector3(center.x,-0.1F,center.z);
//begin scanning
pf.Scan ();
cusSeeker.Rescan = true;
}
示例2: IniPathfindGraph
// Initiate, resize and Scan the pathfind GridGraph
public void IniPathfindGraph(int _sizeX, int _sizeZ)
{
_Astar = GameObject.FindGameObjectWithTag ("Astar").GetComponent<AstarPath>();
GridGraph _Graph = AstarPath.active.astarData.gridGraph;
_Graph.width = _sizeX;
_Graph.depth = _sizeZ;
_Graph.center = new Vector3(_sizeX/2, 0.0f, _sizeZ/2);
_Graph.UpdateSizeFromWidthDepth();
_Graph.Scan();
_Astar.Scan ();
AstarPath.active.Scan ();
}
示例3: Start
// Use this for initialization
void Start ()
{
// initialize lists
checkpoint_Transforms = new List<Transform> ();
checkpoint_Objects = new List<GameObject> ();
patrol_Transforms = new List<Transform> ();
patrol_Scripts = new List<Patrol> ();
score_Texts = new List<GUIText> ();
remaining_Texts = new List<GUIText> ();
// build the level
level_End = false;
string[][] currentLevel = ReadLevel (LevelFile);
BuildLevel (currentLevel);
string[][] currentEntities = ReadLevel (EntityFile);
BuildEntities (currentEntities);
// select our checkpoints
ChooseCheckpoints ();
Debug.Log (checkpoint_Objects.Count);
// get components and objects
compass = player_Transform.Find ("camera_main/compass").GetComponent<Compass> ();
audio_Controller_Script = AudioControllerObject.GetComponent<AudioController> ();
audio_Controller_Script.FadeSpeed = FadeSpeed;
scene_Fader = FindObjectOfType<GUITexture> ().GetComponent<SceneFadeInOut> ();
scene_Fader.FadeSpeed = FadeSpeed;
// initialize the pathfinder
a_Star_Path = Astar.GetComponent<AstarPath> ();
a_Star_Path.UpdateGraphs (new Pathfinding.GraphUpdateObject ());
a_Star_Path.Scan ();
// build the patrollers - this needs to be done after the pathfinder is up
string[][] currentPatrols = ReadLevel (PatrolFile);
BuildPatrols (currentPatrols);
foreach (Patrol current_patrol in patrol_Scripts) {
current_patrol.FadeSpeed = FadeSpeed;
}
// set the first checkpoint
next_Checkpoint = 0;
checkpoint_Objects [next_Checkpoint].SetActive (true);
// setup GUI
foreach (GUIText text in FindObjectsOfType<GUIText>()) {
if (text.name.Contains ("text_score"))
score_Texts.Add (text);
if (text.name.Contains ("text_remaining"))
remaining_Texts.Add (text);
}
RenderText ();
}