当前位置: 首页>>代码示例>>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;未经允许,请勿转载。