Ejemplo n.º 1
0
        private bool AddInnerRendererAndSetInnerMeshRadius(SgtCorona corona, bool apply)
        {
            if (corona.CachedSharedMaterial.RendererCount == 0)
            {
                var meshRenderer = corona.GetComponentInParent <MeshRenderer>();

                if (meshRenderer != null)
                {
                    var meshFilter = meshRenderer.GetComponent <MeshFilter>();

                    if (meshFilter != null)
                    {
                        var mesh = meshFilter.sharedMesh;

                        if (mesh != null)
                        {
                            if (apply == true)
                            {
                                corona.CachedSharedMaterial.AddRenderer(meshRenderer);
                                corona.InnerMeshRadius = SgtHelper.GetMeshRadius(mesh);
                            }

                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        private bool AddInnerRendererAndSetInnerMeshRadius(SgtAtmosphere atmosphere, bool apply)
        {
            if (atmosphere.CachedSharedMaterial.RendererCount == 0)
            {
                var meshRenderer = atmosphere.GetComponentInParent <MeshRenderer>();

                if (meshRenderer != null)
                {
                    var meshFilter = meshRenderer.GetComponent <MeshFilter>();

                    if (meshFilter != null)
                    {
                        var mesh = meshFilter.sharedMesh;

                        if (mesh != null)
                        {
                            if (apply == true)
                            {
                                atmosphere.CachedSharedMaterial.AddRenderer(meshRenderer);
                                atmosphere.InnerMeshRadius = SgtHelper.GetMeshRadius(mesh);
                                atmosphere.UpdateModel();
                            }

                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        private bool SetOuterMeshAndOuterMeshRadius(SgtCorona corona, bool apply)
        {
            if (corona.OuterMesh == null)
            {
                var mesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere40 t:mesh");

                if (mesh != null)
                {
                    if (apply == true)
                    {
                        corona.OuterMesh       = mesh;
                        corona.OuterMeshRadius = SgtHelper.GetMeshRadius(mesh);
                    }

                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 4
0
        private bool SetMeshAndMeshRadius(SgtJovian jovian, bool apply)
        {
            if (jovian.Mesh == null)
            {
                var mesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere40 t:mesh");

                if (mesh != null)
                {
                    if (apply == true)
                    {
                        jovian.Mesh       = mesh;
                        jovian.MeshRadius = SgtHelper.GetMeshRadius(mesh);
                    }

                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 5
0
        private bool SetMeshAndMeshRadius(SgtCloudsphere cloudsphere, bool apply)
        {
            if (cloudsphere.Mesh == null)
            {
                var mesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere40 t:mesh");

                if (mesh != null)
                {
                    if (apply == true)
                    {
                        cloudsphere.Mesh       = mesh;
                        cloudsphere.MeshRadius = SgtHelper.GetMeshRadius(mesh);
                    }

                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 6
0
        private bool SetOuterMeshAndOuterMeshRadius(SgtAtmosphere atmosphere, bool apply)
        {
            if (atmosphere.OuterMesh == null)
            {
                var mesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere40 t:mesh");

                if (mesh != null)
                {
                    if (apply == true)
                    {
                        atmosphere.OuterMesh       = mesh;
                        atmosphere.OuterMeshRadius = SgtHelper.GetMeshRadius(mesh);

                        atmosphere.UpdateMaterials();
                        atmosphere.UpdateModel();
                    }

                    return(true);
                }
            }

            return(false);
        }
        private bool SetMeshAndSetMeshRadius(SgtSingularity singularity, bool apply)
        {
            if (singularity.Mesh == null)
            {
                var mesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere40 t:mesh");

                if (mesh != null)
                {
                    if (apply == true)
                    {
                        singularity.Mesh       = mesh;
                        singularity.MeshRadius = SgtHelper.GetMeshRadius(mesh);

                        singularity.UpdateMaterial();
                        singularity.UpdateModel();
                    }

                    return(true);
                }
            }

            return(false);
        }