This file contains 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
Use the command line to extract the package. | |
program.exe packagePath outputPath extractMetaFiles | |
program.exe "d:\dir\package.unitypackage" "d:\outputDir" "true" |
This file contains 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
//camera-like projection matrix | |
var cameraData = new CameraDataForBurst(camera); | |
//or | |
//projection matrix for the rendering target of a given size | |
var cameraData = new CameraDataForBurst(camera, 320, 240); | |
var worldPoint = new float3(10, 10, 0); | |
var screenPointWithZ = cameraData.WorldToScreenPointWithZ(worldPoint); | |
var screenPoint = cameraData.WorldToScreenPoint(worldPoint); |
This file contains 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
//The code is based on the code from here: https://stackoverflow.com/a/10177020/1221983 | |
//And adapted for NET 8 and Unity. | |
//Reduced memory consumption. | |
//Added possibility to encrypt byte arrays, not only strings. | |
//You can also attach custom data that will not be encrypted. | |
var password = "nso%dhfkl$siohf"; | |
var str = "This is test string!№;%^#@^&"; |
This file contains 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
Interaction in unity with Gradient via jobs + burst | |
var gradient = new Gradient(); | |
//Access Gradient.colorKeys and Gradient.alphaKey via NativeArray without a Garbage Collector: | |
//Single threaded mode: | |
var gradientPtr = gradient.DirectAccess(); | |
using var colorKeys = gradientPtr->GetColorKeys(Allocator.Temp); | |
using var alphaKeys = gradientPtr->GetAlphaKeys(Allocator.Temp); |