예제 #1
0
        public void Despawn()
        {
            if (OnDespawn != null)
            {
                OnDespawn();
            }

            if (Renderers != null && sharedMaterial != null)
            {
                for (var i = Renderers.Count - 1; i >= 0; i--)
                {
                    var renderer = Renderers[i];

                    if (renderer != null)
                    {
                        sharedMaterial.RemoveRenderer(renderer);
                    }
                }
            }

            if (Pool == true)
            {
                SgtComponentPool <SgtTerrainObject> .Add(this);
            }
            else
            {
                SgtHelper.Destroy(gameObject);
            }
        }
예제 #2
0
        public static SgtAtmosphereModel Create(SgtAtmosphere atmosphere)
        {
            var outer = SgtComponentPool <SgtAtmosphereModel> .Pop(atmosphere.transform, "Atmosphere Model", atmosphere.gameObject.layer);

            outer.Atmosphere = atmosphere;

            return(outer);
        }
        public static SgtAccretionModel Create(SgtAccretion accretion)
        {
            var model = SgtComponentPool <SgtAccretionModel> .Pop(accretion.transform, "Accretion Model", accretion.gameObject.layer);

            model.Accretion = accretion;

            return(model);
        }
        public static SgtRingModel Create(SgtRing ring)
        {
            var segment = SgtComponentPool <SgtRingModel> .Pop(ring.transform, "Ring Model", ring.gameObject.layer);

            segment.Ring = ring;

            return(segment);
        }
예제 #5
0
        public static SgtCoronaModel Create(SgtCorona corona)
        {
            var model = SgtComponentPool <SgtCoronaModel> .Pop(corona.transform, "Corona Model", corona.gameObject.layer);

            model.Corona = corona;

            return(model);
        }
예제 #6
0
        public static SgtLightning Create(SgtLightningSpawner lightningSpawner)
        {
            var model = SgtComponentPool <SgtLightning> .Pop(lightningSpawner.transform, "Lightning", lightningSpawner.gameObject.layer);

            model.LightningSpawner = lightningSpawner;

            return(model);
        }
        public static SgtProminenceModel Create(SgtProminence prominence)
        {
            var plane = SgtComponentPool <SgtProminenceModel> .Pop(prominence.transform, "Prominence Model", prominence.gameObject.layer);

            plane.Prominence = prominence;

            return(plane);
        }
        public static SgtQuadsModel Create(SgtQuads quads)
        {
            var model = SgtComponentPool <SgtQuadsModel> .Pop(quads.transform, "Quads Model", quads.gameObject.layer);

            model.Quads = quads;

            return(model);
        }
        public static SgtJovianModel Create(SgtJovian jovian)
        {
            var model = SgtComponentPool <SgtJovianModel> .Pop(jovian.transform, "Jovian Model", jovian.gameObject.layer);

            model.Jovian = jovian;

            return(model);
        }
예제 #10
0
        public static SgtCloudsphereModel Create(SgtCloudsphere cloudsphere)
        {
            var model = SgtComponentPool <SgtCloudsphereModel> .Pop(cloudsphere.transform, "Cloudsphere Model", cloudsphere.gameObject.layer);

            model.Cloudsphere = cloudsphere;

            return(model);
        }
        public static SgtAuroraModel Create(SgtAurora aurora)
        {
            var model = SgtComponentPool <SgtAuroraModel> .Pop(aurora.transform, "Aurora Model", aurora.gameObject.layer);

            model.Aurora = aurora;

            return(model);
        }
        public static SgtSingularityModel Create(SgtSingularity singularity)
        {
            var model = SgtComponentPool <SgtSingularityModel> .Pop(singularity.transform, "Singularity Model", singularity.gameObject.layer);

            model.Singularity = singularity;

            return(model);
        }
예제 #13
0
        public static SgtFlareModel Create(SgtFlare flare)
        {
            var model = SgtComponentPool <SgtFlareModel> .Pop(flare.transform, "Flare Model", flare.gameObject.layer);

            model.Flare = flare;

            return(model);
        }
예제 #14
0
        public static void Pool(SgtRingModel segment)
        {
            if (segment != null)
            {
                segment.Ring = null;

                SgtComponentPool <SgtRingModel> .Add(segment);
            }
        }
        public static void Pool(SgtJovianModel model)
        {
            if (model != null)
            {
                model.Jovian = null;

                SgtComponentPool <SgtJovianModel> .Add(model);
            }
        }
예제 #16
0
        public static void Pool(SgtLightning model)
        {
            if (model != null)
            {
                model.LightningSpawner = null;

                SgtComponentPool <SgtLightning> .Add(model);
            }
        }
        public static void Pool(SgtSingularityModel model)
        {
            if (model != null)
            {
                model.Singularity = null;

                SgtComponentPool <SgtSingularityModel> .Add(model);
            }
        }
예제 #18
0
        public static void Pool(SgtAtmosphereModel outer)
        {
            if (outer != null)
            {
                outer.Atmosphere = null;

                SgtComponentPool <SgtAtmosphereModel> .Add(outer);
            }
        }
예제 #19
0
        public static void Pool(SgtCloudsphereModel model)
        {
            if (model != null)
            {
                model.Cloudsphere = null;

                SgtComponentPool <SgtCloudsphereModel> .Add(model);
            }
        }
        public static void Pool(SgtAccretionModel model)
        {
            if (model != null)
            {
                model.Accretion = null;

                SgtComponentPool <SgtAccretionModel> .Add(model);
            }
        }
        public static void Pool(SgtAuroraModel model)
        {
            if (model != null)
            {
                model.Aurora = null;

                SgtComponentPool <SgtAuroraModel> .Add(model);
            }
        }
        public static void Pool(SgtProminenceModel plane)
        {
            if (plane != null)
            {
                plane.Prominence = null;

                SgtComponentPool <SgtProminenceModel> .Add(plane);
            }
        }
        public static void Pool(SgtQuadsModel model)
        {
            if (model != null)
            {
                model.Quads = null;

                model.PoolMeshNow();

                SgtComponentPool <SgtQuadsModel> .Add(model);
            }
        }
예제 #24
0
        private static SgtTerrainObject Despawn(SgtTerrainObject prefab)
        {
            if (prefab.Pool == true)
            {
                SgtComponentPool <SgtTerrainObject> .Add(prefab);
            }
            else
            {
                prefab.Despawn();
            }

            return(null);
        }
예제 #25
0
        private void Despawn(SgtDebris debris)
        {
            debris.InvokeOnDespawn();

            if (debris.Pool == true)
            {
                SgtComponentPool <SgtDebris> .Add(debris);
            }
            else
            {
                SgtHelper.Destroy(debris.gameObject);
            }
        }
예제 #26
0
        private void Despawn(SgtDebris debris, int index)
        {
            debris.InvokeOnDespawn();

            if (debris.Pool == true)
            {
                SgtComponentPool <SgtDebris> .Add(debris);
            }
            else
            {
                SgtHelper.Destroy(debris.gameObject);
            }

            this.debris.RemoveAt(index);
        }
예제 #27
0
        private static SgtTerrainObject Spawn(SgtTerrainObject prefab)
        {
            if (prefab.Pool == true)
            {
                targetPrefab = prefab;

                var clone = SgtComponentPool <SgtTerrainObject> .Pop(ObjectMatch);

                if (clone != null)
                {
                    return(clone);
                }
            }

            return(Instantiate(prefab));
        }
예제 #28
0
        public void Despawn()
        {
            if (OnDespawn != null)
            {
                OnDespawn();
            }

            if (Pool == true)
            {
                SgtComponentPool <SgtTerrainObject> .Add(this);
            }
            else
            {
                SgtHelper.Destroy(gameObject);
            }
        }
예제 #29
0
        private SgtDebris Spawn(SgtDebris prefab)
        {
            if (prefab.Pool == true)
            {
                targetPrefab = prefab;

                var debris = SgtComponentPool <SgtDebris> .Pop(DebrisMatch);

                if (debris != null)
                {
                    debris.transform.SetParent(null, false);

                    return(debris);
                }
            }

            return(Instantiate(prefab));
        }
예제 #30
0
        public static SgtTerrainFace Pool(SgtTerrainFace face)
        {
            if (face != null)
            {
                face.Terrain = null;

                if (face.Split == true)
                {
                    face.Split   = false;
                    face.ChildBL = Pool(face.ChildBL);
                    face.ChildBR = Pool(face.ChildBR);
                    face.ChildTL = Pool(face.ChildTL);
                    face.ChildTR = Pool(face.ChildTR);
                }

                SgtComponentPool <SgtTerrainFace> .Add(face);
            }

            return(null);
        }