public static void Pool(SgtCoronaOuter outer)
    {
        if (outer != null)
        {
            outer.Corona = null;

            SgtComponentPool <SgtCoronaOuter> .Add(outer);
        }
    }
Exemple #2
0
    public static void Pool(SgtThrusterFlare flare)
    {
        if (flare != null)
        {
            flare.Thruster = null;

            SgtComponentPool <SgtThrusterFlare> .Add(flare);
        }
    }
Exemple #3
0
    public static void Pool(SgtJovianModel model)
    {
        if (model != null)
        {
            model.Jovian = null;

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

            SgtComponentPool <SgtProminencePlane> .Add(plane);
        }
    }
Exemple #5
0
    public static void Pool(SgtRingSegment segment)
    {
        if (segment != null)
        {
            segment.Ring = null;

            SgtComponentPool <SgtRingSegment> .Add(segment);
        }
    }
    public static void Pool(SgtAtmosphereOuter outer)
    {
        if (outer != null)
        {
            outer.Atmosphere = null;

            SgtComponentPool <SgtAtmosphereOuter> .Add(outer);
        }
    }
Exemple #7
0
    public static void Pool(SgtLightning model)
    {
        if (model != null)
        {
            model.LightningSpawner = null;

            SgtComponentPool <SgtLightning> .Add(model);
        }
    }
Exemple #8
0
    public static void Pool(SgtCloudsphereModel model)
    {
        if (model != null)
        {
            model.Cloudsphere = null;

            SgtComponentPool <SgtCloudsphereModel> .Add(model);
        }
    }
Exemple #9
0
    public static void Pool(SgtAuroraModel model)
    {
        if (model != null)
        {
            model.Aurora = null;

            SgtComponentPool <SgtAuroraModel> .Add(model);
        }
    }
Exemple #10
0
    protected virtual void Update()
    {
        Life -= Time.deltaTime;

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

            SgtComponentPool <SgtSingularityModel> .Add(model);
        }
    }
Exemple #12
0
    public static void Pool(SgtQuadsModel model)
    {
        if (model != null)
        {
            model.Quads = null;

            model.PoolMeshNow();

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

            model.PoolMeshNow();

            SgtComponentPool <SgtBeltModel> .Add(model);
        }
    }
Exemple #14
0
    public static SgtTerrainFace Pool(SgtTerrainFace face)
    {
        if (face != null)
        {
            face.Terrain  = null;
            face.Material = null;

            SgtComponentPool <SgtTerrainFace> .Add(face);
        }

        return(null);
    }
Exemple #15
0
    private static SgtTerrainObject Despawn(SgtTerrainObject prefab)
    {
        if (prefab.Pool == true)
        {
            SgtComponentPool <SgtTerrainObject> .Add(prefab);
        }
        else
        {
            prefab.Despawn();
        }

        return(null);
    }
Exemple #16
0
    public static SgtTerrainLevel Pool(SgtTerrainLevel level)
    {
        if (level != null)
        {
            level.Face = null;

            level.PoolMeshNow();
            level.PoolColliderMeshNow();

            SgtComponentPool <SgtTerrainLevel> .Add(level);
        }

        return(null);
    }
    public void Despawn()
    {
        if (OnDespawn != null)
        {
            OnDespawn();
        }

        if (Pool == true)
        {
            SgtComponentPool <SgtTerrainObject> .Add(this);
        }
        else
        {
            SgtHelper.Destroy(gameObject);
        }
    }
Exemple #18
0
    private void Despawn(SgtDebris debris)
    {
        if (debris.OnDespawn != null)
        {
            debris.OnDespawn();
        }

        if (debris.Pool == true)
        {
            SgtComponentPool <SgtDebris> .Add(debris);
        }
        else
        {
            SgtHelper.Destroy(debris.gameObject);
        }
    }
    public static void Pool(SgtStarfieldGroup group)
    {
        if (group != null)
        {
            group.Starfield = null;
            group.Texture   = null;
            group.Material  = null;

            for (var i = group.Models.Count - 1; i >= 0; i--)
            {
                SgtStarfieldModel.Pool(group.Models[i]);
            }

            group.Models.Clear();

            SgtComponentPool <SgtStarfieldGroup> .Add(group);
        }
    }
    public static void Pool(SgtBeltGroup group)
    {
        if (group != null)
        {
            group.Belt      = null;
            group.MainTex   = null;
            group.HeightTex = null;
            group.Material  = null;

            for (var i = group.Models.Count - 1; i >= 0; i--)
            {
                SgtBeltModel.Pool(group.Models[i]);
            }

            group.Models.Clear();

            SgtComponentPool <SgtBeltGroup> .Add(group);
        }
    }
Exemple #21
0
    public static SgtPatch Pool(SgtPatch patch)
    {
        if (patch != null)
        {
            patch.ChildBL = Pool(patch.ChildBL);
            patch.ChildBR = Pool(patch.ChildBR);
            patch.ChildTL = Pool(patch.ChildTL);
            patch.ChildTR = Pool(patch.ChildTR);

            patch.Terrain       = null;
            patch.Parent        = null;
            patch.Material      = null;
            patch.FinalMaterial = null;

            patch.PoolMeshNow();

            SgtComponentPool <SgtPatch> .Add(patch);
        }

        return(null);
    }
Exemple #22
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("_Age", SgtHelper.Divide(Age, Life));
            }
        }
    }
Exemple #23
0
    protected virtual void OnWillRenderObject()
    {
        if (meshRenderer != null)
        {
            if (Sprite != null && Life > 0.0f && MaxLife > 0.0f)
            {
                var uv = SgtHelper.CalculateSpriteUV(Sprite);

                material.SetTexture("_MainTex", Sprite.texture);

                material.SetFloat("_Age", 1.0f - Life / MaxLife);

                material.SetColor("_Color", SgtHelper.Brighten(Color, Brightness));

                material.SetVector("_Offset", new Vector2(uv.x, uv.y));

                material.SetVector("_Scale", new Vector2(uv.z - uv.x, uv.w - uv.y));
            }
            else
            {
                SgtComponentPool <SgtLightning> .Add(this);
            }
        }
    }