Пример #1
0
		/// <summary>
		/// Spawns and returns a new GameObject from this template into the given region
		/// </summary>
		/// <returns>The newly spawned GameObject or null, if the Template has no Entry associated with it.</returns>
		public GameObject Spawn(Region region)
		{
			if (Entry == null)
			{
				return null;
			}
			var go = GameObject.Create(Entry, this);
			go.Position = Pos;
			region.AddObject(go);
			return go;
		}
Пример #2
0
		public NPC SpawnAt(Region rgn, Vector3 pos)
		{
			var npc = Create(rgn.DifficultyIndex);
			rgn.AddObject(npc, pos);
			return npc;
		}
Пример #3
0
		public NPC Create(Region rgn, Vector3 pos)
		{
			var npc = NPCCreator(this);
			npc.SetupNPC(this, null);
			rgn.AddObject(npc, pos);
			return npc;
		}
Пример #4
0
		/// <summary>
		/// Spawns and returns a new GameObject from this template into the given region
		/// </summary>
		/// <param name="owner">Can be null, if the GO is not owned by anyone</param>
		/// <returns>The newly spawned GameObject or null, if the Template has no Entry associated with it.</returns>
		public GameObject Spawn(Region rgn, ref Vector3 pos, Unit owner)
		{
			var go = Create(owner);
			go.Position = pos;
			rgn.AddObject(go);
			return go;
		}