Ejemplo n.º 1
0
        /// <summary>
        /// Instantiate a creator planet system based on the specified spawn origin.
        /// </summary>
        /// <param name="creator">The creator.</param>
        /// <param name="spawnOrigin">The spawn origin.</param>
        /// <returns>The planet.</returns>
        public BasePlanet Instantiate(Creator creator, Vector3 spawnOrigin)
        {
            Vector3 randomSpawnPosition = this.CreateRandomSpawnPositionInView(spawnOrigin);

            GameObject objectInstaniated = this.Instantiate(this.creatorPlanetSystemPrefab, randomSpawnPosition, creator.UniqueId);

            CreatorPlanet creatorPlanet = objectInstaniated.GetComponentInChildren<CreatorPlanet>();
            creatorPlanet.HookUp(creator);

            return creatorPlanet;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Instantiates a creator planet system.
        /// </summary>
        /// <param name="creator">The creator.</param>
        /// <returns>The planet.</returns>
        public BasePlanet Instantiate(Creator creator)
        {
            GameObject objectInstaniated = this.Instantiate(this.creatorPlanetSystemPrefab, this.initialPlanetSystemPosition, creator.UniqueId);

            CreatorPlanet creatorPlanet = objectInstaniated.GetComponentInChildren<CreatorPlanet>();
            creatorPlanet.HookUp(creator);

            return creatorPlanet;
        }