/// <summary> /// Instantiate an event planet system based on the specified spawn origin. /// </summary> /// <param name="comicEvent">The comic event.</param> /// <param name="spawnOrigin">The spawn origin.</param> /// <returns>The planet.</returns> public BasePlanet Instantiate(MarvelUniverse.Model.Event.Event comicEvent, Vector3 spawnOrigin) { Vector3 randomSpawnPosition = this.CreateRandomSpawnPositionInView(spawnOrigin); GameObject objectInstaniated = this.Instantiate(this.eventPlanetSystemPrefab, randomSpawnPosition, comicEvent.UniqueId); EventPlanet eventPlanet = objectInstaniated.GetComponentInChildren<EventPlanet>(); eventPlanet.HookUp(comicEvent); return eventPlanet; }
/// <summary> /// Instantiates an event planet system. /// </summary> /// <param name="comicEvent">The event.</param> /// <returns>The planet.</returns> public BasePlanet Instantiate(MarvelUniverse.Model.Event.Event comicEvent) { GameObject objectInstaniated = this.Instantiate(this.eventPlanetSystemPrefab, this.initialPlanetSystemPosition, comicEvent.UniqueId); EventPlanet eventPlanet = objectInstaniated.GetComponentInChildren<EventPlanet>(); eventPlanet.HookUp(comicEvent); return eventPlanet; }