Пример #1
0
        /// <summary>
        /// Instantiate a comic planet system based on the specified spawn origin.
        /// </summary>
        /// <param name="comic">The comic.</param>
        /// <param name="spawnOrigin">The spawn origin.</param>
        /// <returns>The planet.</returns>
        public BasePlanet Instantiate(Comic comic, Vector3 spawnOrigin)
        {
            Vector3 randomSpawnPosition = this.CreateRandomSpawnPositionInView(spawnOrigin);

            GameObject objectInstaniated = this.Instantiate(this.comicPlanetSystemPrefab, randomSpawnPosition, comic.UniqueId);

            ComicPlanet comicPlanet = objectInstaniated.GetComponentInChildren<ComicPlanet>();
            comicPlanet.HookUp(comic);

            return comicPlanet;
        }
Пример #2
0
        /// <summary>
        /// Instantiates a comic planet system.
        /// </summary>
        /// <param name="comic">The comic.</param>
        /// <returns>The planet.</returns>
        public BasePlanet Instantiate(Comic comic)
        {
            GameObject objectInstaniated = this.Instantiate(this.comicPlanetSystemPrefab, this.initialPlanetSystemPosition, comic.UniqueId);

            ComicPlanet comicPlanet = objectInstaniated.GetComponentInChildren<ComicPlanet>();
            comicPlanet.HookUp(comic);

            return comicPlanet;
        }