Last active
February 11, 2016 18:42
-
-
Save boformer/701514e1a07395a66cc1 to your computer and use it in GitHub Desktop.
Revisions
-
boformer revised this gist
Feb 11, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ { foreach (KeyValuePair<string, Texture2D> entry in currentPrefabProperties) { Texture2D texture2D = entry.Value; if(texture2D == null) continue; // null-Werte skippen -
boformer revised this gist
Feb 11, 2016 . 1 changed file with 3 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,20 +3,17 @@ foreach (KeyValuePair<string, Texture2D> entry in currentPrefabProperties) { Texture2D texture2D = entry.Value as Texture2D; if(texture2D == null) continue; // null-Werte skippen var filename = ModLoader.currentTexturesPath_default + texture2D.name + ".dds"; if (File.Exists(filename)) { currentPrefabProperties.Remove(entry.Key); currentPrefabProperties.Add(entry.Key, LoadTextureDDS(filename) as Texture2D); } { }// do something with entry.Value or entry.Key } } -
tommargar created this gist
Feb 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ public static void GetTextureName() { foreach (KeyValuePair<string, Texture2D> entry in currentPrefabProperties) { Texture2D texture2D = entry.Value as Texture2D; RenderTexture temporary = RenderTexture.GetTemporary(texture2D.width, texture2D.height, 0); Graphics.Blit(texture2D, temporary); var filename = ModLoader.currentTexturesPath_default + temporary.name + ".dds"; if (File.Exists(filename)) { currentPrefabProperties.Remove(entry.Key); currentPrefabProperties.Add(entry.Key, LoadTextureDDS(filename) as Texture2D); } RenderTexture.ReleaseTemporary(temporary); { }// do something with entry.Value or entry.Key } }