Пример #1
0
        public static optional <OctahedronPlanetarium> load(string file_name)
        {
            optional <Material> material = WorldPlanetarium.load_material(file_name);

            if (!material.exists)
            {
                return(new optional <OctahedronPlanetarium>());
            }
            Texture2D             texture = (Texture2D)WorldPlanetarium.load_texture(file_name);
            OctahedronPlanetarium result  = new OctahedronPlanetarium(texture.width);

            result.material = material.data;
            result.texture  = texture;
            result.material.SetTexture("_MainTex", result.texture);
            return(result);
        }
        public static optional <SphericalCirclePlanetarium> load(string file_name, float radius)
        {
            optional <Material> material = WorldPlanetarium.load_material(file_name);

            if (!material.exists)
            {
                return(new optional <SphericalCirclePlanetarium>());
            }
            SphericalCirclePlanetarium result = new SphericalCirclePlanetarium();

            result.material = material.data;
            result.texture  = (Texture2D)WorldPlanetarium.load_texture(file_name);
            result.material.SetTexture("_MainTex", result.texture);
            result.radius_variable = radius;
            return(result);
        }