コード例 #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 void Pool(SgtJovianModel model)
        {
            if (model != null)
            {
                model.Jovian = null;

                SgtComponentPool <SgtJovianModel> .Add(model);
            }
        }
コード例 #3
0
        public static void Pool(SgtCloudsphereModel model)
        {
            if (model != null)
            {
                model.Cloudsphere = null;

                SgtComponentPool <SgtCloudsphereModel> .Add(model);
            }
        }
コード例 #4
0
        public static void Pool(SgtLightning model)
        {
            if (model != null)
            {
                model.LightningSpawner = null;

                SgtComponentPool <SgtLightning> .Add(model);
            }
        }
コード例 #5
0
        public static void Pool(SgtAccretionModel model)
        {
            if (model != null)
            {
                model.Accretion = null;

                SgtComponentPool <SgtAccretionModel> .Add(model);
            }
        }
コード例 #6
0
        public static void Pool(SgtProminenceModel plane)
        {
            if (plane != null)
            {
                plane.Prominence = null;

                SgtComponentPool <SgtProminenceModel> .Add(plane);
            }
        }
コード例 #7
0
        public static void Pool(SgtSingularityModel model)
        {
            if (model != null)
            {
                model.Singularity = null;

                SgtComponentPool <SgtSingularityModel> .Add(model);
            }
        }
コード例 #8
0
        public static void Pool(SgtAtmosphereModel outer)
        {
            if (outer != null)
            {
                outer.Atmosphere = null;

                SgtComponentPool <SgtAtmosphereModel> .Add(outer);
            }
        }
コード例 #9
0
        public static void Pool(SgtRingModel segment)
        {
            if (segment != null)
            {
                segment.Ring = null;

                SgtComponentPool <SgtRingModel> .Add(segment);
            }
        }
コード例 #10
0
        public static void Pool(SgtAuroraModel model)
        {
            if (model != null)
            {
                model.Aurora = null;

                SgtComponentPool <SgtAuroraModel> .Add(model);
            }
        }
コード例 #11
0
        public static void Pool(SgtQuadsModel model)
        {
            if (model != null)
            {
                model.Quads = null;

                model.PoolMeshNow();

                SgtComponentPool <SgtQuadsModel> .Add(model);
            }
        }
コード例 #12
0
        private static SgtTerrainObject Despawn(SgtTerrainObject prefab)
        {
            if (prefab.Pool == true)
            {
                SgtComponentPool <SgtTerrainObject> .Add(prefab);
            }
            else
            {
                prefab.Despawn();
            }

            return(null);
        }
コード例 #13
0
        private void Despawn(SgtDebris debris)
        {
            debris.InvokeOnDespawn();

            if (debris.Pool == true)
            {
                SgtComponentPool <SgtDebris> .Add(debris);
            }
            else
            {
                SgtHelper.Destroy(debris.gameObject);
            }
        }
コード例 #14
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);
        }
コード例 #15
0
        public void Despawn()
        {
            if (OnDespawn != null)
            {
                OnDespawn();
            }

            if (Pool == true)
            {
                SgtComponentPool <SgtTerrainObject> .Add(this);
            }
            else
            {
                SgtHelper.Destroy(gameObject);
            }
        }
コード例 #16
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);
        }
コード例 #17
0
        protected virtual void Update()
        {
            if (LightningSpawner == null)
            {
                Pool(this);
            }
            else
            {
                if (Application.isPlaying == true)
                {
                    Age += Time.deltaTime;
                }

                if (Age >= Life)
                {
                    SgtComponentPool <SgtLightning> .Add(this);
                }
                else if (material != null)
                {
                    material.SetFloat(SgtShader._Age, SgtHelper.Divide(Age, Life));
                }
            }
        }