当前位置: 首页>>代码示例>>C#>>正文


C# AstarPath.UpdateGraphs方法代码示例

本文整理汇总了C#中AstarPath.UpdateGraphs方法的典型用法代码示例。如果您正苦于以下问题:C# AstarPath.UpdateGraphs方法的具体用法?C# AstarPath.UpdateGraphs怎么用?C# AstarPath.UpdateGraphs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AstarPath的用法示例。


在下文中一共展示了AstarPath.UpdateGraphs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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 ();
	}
开发者ID:rjhelms,项目名称:LD30-Smugglers,代码行数:61,代码来源:GameController.cs


注:本文中的AstarPath.UpdateGraphs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。