예제 #1
0
        public static void CreateMenuItem()
        {
            var parent   = SgtHelper.GetSelectedParent();
            var instance = Create(parent != null ? parent.gameObject.layer : 0, parent);

            instance.cachedMeshFilter.sharedMesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere40 t:mesh");

            SgtHelper.SelectAndPing(instance);
        }
예제 #2
0
        private bool SetMesh(SgtLens lens, bool apply)
        {
            if (lens.Mesh == null)
            {
                var mesh = SgtHelper.LoadFirstAsset <Mesh>("Geosphere20 t:mesh");

                if (mesh != null)
                {
                    if (apply == true)
                    {
                        lens.Mesh = mesh;
                    }

                    return(true);
                }
            }

            return(false);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }