當前位置: 首頁>>代碼示例>>C#>>正文


C# Spawner.GetSpawnPosition方法代碼示例

本文整理匯總了C#中Server.Mobiles.Spawner.GetSpawnPosition方法的典型用法代碼示例。如果您正苦於以下問題:C# Spawner.GetSpawnPosition方法的具體用法?C# Spawner.GetSpawnPosition怎麽用?C# Spawner.GetSpawnPosition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Mobiles.Spawner的用法示例。


在下文中一共展示了Spawner.GetSpawnPosition方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SpawnAt

		public Mobile SpawnAt( Spawner spawner, Mobile mob )
		{
			Map map = spawner.Map;

			if ( map == null || map == Map.Internal )
				return null;

			if ((mob is BaseCreature) == false)
				return null;

			try
			{
				BaseOverland bo = null;
				BaseCreature bc = mob as BaseCreature;
				// we will make it so this is passed in
				if (mob is BaseOverland)
					bo = mob as BaseOverland;

				// use the spawners homerange except when it is a special 'guard post' 
				//	spawner (HomeRange == 0)
				bc.RangeHome = spawner.HomeRange == 0? 10 : spawner.HomeRange;

				// could be useful ... but not today
				// c.CurrentWayPoint = spawner.WayPoint;
				// c.NavDestination = spawner.NavPoint;

				bc.Home = spawner.Location;
				bc.Spawner = spawner;
				
				//if we have a navdestination as soon as we spawn start on it
				if(bc.NavDestination != NavDestinations.None)
					bc.AIObject.Think();

				/////////////////////////////
				// move it to the world
				Point3D loc = spawner.GetSpawnPosition(bc);
				bc.MoveToWorld( loc, map );

				// Okay, indicate that this overland mob should be announced on the Town Crier
				// This must be after we are moved off the internal map because the accounce code
				//	supplies 'world location' information which would be wrong if we were still on the internal map
				if (bo != null)
					bo.Announce = true;

				return bc;
			}
			catch (Exception e) 
			{
				LogHelper.LogException(e);
				Console.WriteLine("Server.Engines.OverlandSpawner : Exception {0}", e);
			}

			return null;
		}
開發者ID:zerodowned,項目名稱:angelisland,代碼行數:54,代碼來源:OverlandSpawner.cs


注:本文中的Server.Mobiles.Spawner.GetSpawnPosition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。