Ejemplo n.º 1
0
            // Load the Map
            public void Load()
            {
                // Check if the Map is already loaded
                if (IsLoaded)
                {
                    return;
                }

                // Load the Map
                Texture2D map = OnDemandStorage.LoadTexture(Path, false, false, false);

                // If the map isn't null
                if (map != null)
                {
                    CreateMap(Depth, map);
                    timer          = new Timer(60000d);
                    timer.Elapsed += delegate(object sender, ElapsedEventArgs e) { Unload(); };
                    timer.Start();
                    IsLoaded = true;
                    Debug.Log("[OD] Map " + name + " enabling self. Path = " + Path);
                    return;
                }

                // Return nothing
                Debug.Log("[OD] ERROR: Failed to load map " + name + " at path " + Path);
            }
Ejemplo n.º 2
0
            void LoadTextures()
            {
                Debug.Log("[OD] --> ScaledSpaceDemand.LoadTextures loading " + texture + " and " + normals);
                // Load Diffuse
                if (OnDemandStorage.TextureExists(texture))
                {
                    scaledRenderer.material.SetTexture("_MainTex", OnDemandStorage.LoadTexture(texture, false, true, true));
                }

                // Load Normals
                if (OnDemandStorage.TextureExists(normals))
                {
                    scaledRenderer.material.SetTexture("_BumpMap", OnDemandStorage.LoadTexture(normals, false, true, false));
                }

                // Flags
                isLoaded = true;
            }
Ejemplo n.º 3
0
            // Load the Map
            public void Load()
            {
                // Check if the Map is already loaded
                if (IsLoaded)
                {
                    return;
                }

                // Load the Map
                Texture2D map = OnDemandStorage.LoadTexture(Path, false, false, false);

                // If the map isn't null
                if (map != null)
                {
                    CreateMap(Depth, map);
                    IsLoaded = true;
                    Debug.Log("[OD] ---> Map " + name + " enabling self. Path = " + Path);
                    return;
                }

                // Return nothing
                Debug.Log("[OD] ERROR: Failed to load map " + name + " at path " + Path);
            }
Ejemplo n.º 4
0
            // OnBecameVisible(), load the texture
            void OnBecameVisible()
            {
                // If it is already loaded, return
                if (isLoaded)
                {
                    return;
                }

                // Load Diffuse
                if (OnDemandStorage.TextureExists(texture))
                {
                    scaledRenderer.material.SetTexture("_MainTex", OnDemandStorage.LoadTexture(texture, false, true, true));
                }

                // Load Normals
                if (OnDemandStorage.TextureExists(normals))
                {
                    scaledRenderer.material.SetTexture("_BumpMap", OnDemandStorage.LoadTexture(normals, false, true, false));
                }

                // Flags
                isLoaded = true;
            }
Ejemplo n.º 5
0
        public void LoadTextures()
        {
            Debug.Log("[OD] --> ScaledSpaceDemand.LoadTextures loading " + texture + " and " + normals);

            // Load Diffuse
            if (OnDemandStorage.TextureExists(texture))
            {
                scaledRenderer.sharedMaterial.SetTexture(MainTex,
                                                         OnDemandStorage.LoadTexture(texture, false, true, true));
            }

            // Load Normals
            if (OnDemandStorage.TextureExists(normals))
            {
                scaledRenderer.sharedMaterial.SetTexture(BumpMap,
                                                         OnDemandStorage.LoadTexture(normals, false, true, false));
            }

            // Events
            Events.OnScaledSpaceLoad.Fire(this);

            // Flags
            isLoaded = true;
        }