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 characters
| class XYRGBA : Y2019.December.Day30.XYRGBA | |
| { | |
| public XYRGBA(int n) : base(n) | |
| { | |
| } | |
| public void something() | |
| { |
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 characters
| public class ExampleDrawGizmos : MonoBehaviour | |
| { | |
| //On draw Gizmos can display debugging information in the Unity Editor | |
| //for easy visual debugging | |
| //Gizmos will not show up in your final game. | |
| //Gizmost are a debuging tool only, NOT a tool to make a game with xD | |
| //This will draw in your sceneview, you can also see it in gameview if you would like to ( | |
| private void OnDrawGizmos() |
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 characters
| class ImageFilePixelLevelOperation_Max | |
| { | |
| //Public functions | |
| public static bool compute(string path_a, string path_b, string path_out) | |
| { | |
| if(!System.IO.File.Exists(path_a)) { return false; } | |
| if(!System.IO.File.Exists(path_b)) { return false; } | |
| Texture2D tex1 = ImageFilePixelLevelOperation_Max.LoadPNG(path_a); | |
| Texture2D tex2 = ImageFilePixelLevelOperation_Max.LoadPNG(path_b); |
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 characters
| System.IO.File.Exists(path); |
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 characters
| static bool Texture2d_isSameSize(in Texture2D a, in Texture2D b) { return ((a.width == b.width) && (a.height == b.height)); } |
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 characters
| void Save_Texture2D(in Texture2D tex, string path) | |
| { | |
| byte[] bytes = tex.EncodeToPNG(); | |
| System.IO.File.WriteAllBytes(path, bytes); | |
| } | |
| //Usage example | |
| //Save_Texture2D(result, @"C:\Users\x\Desktop\x\out.png"); | |
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 characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class TakeSpherical360 : MonoBehaviour | |
| { | |
| public Camera cam; | |
| private RenderTexture renderTexture_left; | |
| private RenderTexture renderTexture_right; |
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 characters
| UnityEngine.Resources.UnloadUnusedAssets(); | |
| //Resources.UnloadAsset(); | |
| //Destroy does nothing to help freeing memory |
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 characters
| import base64 | |
| text = """ | |
| <html><body> | |
| <img src="data:image/png;base64,ae8f0c79-2893-4a82-8576-7478e18a5356" alt="Red dot" /> | |
| </body></html> | |
| """ | |
| def Image_To_HTML_64_EncodedImage(path_to_image, out_path): | |
| with open(path_to_image, "rb") as image_file: |
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 characters
| foreach(KeyValuePair<string, string> entry in myDictionary) | |
| { | |
| // do something with entry.Value or entry.Key | |
| } |