Skip to content

Instantly share code, notes, and snippets.

View phamtanlong's full-sized avatar

Pham Tan Long phamtanlong

View GitHub Profile
@desmondfernando
desmondfernando / DisableHWStats.cs
Last active June 3, 2024 01:44
Code snippet to disable HW statistics reporting. NOTE only works in the Editor not for runtime! Unity Pro only
var type = Type.GetType( "UnityEditor.PlayerSettings,UnityEditor" );
if ( type != null )
{
var propertyInfo = type.GetProperty( "submitAnalytics", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static );
if ( propertyInfo != null )
{
{
var value = (bool)propertyInfo.GetValue( null, null );
Debug.LogFormat( "PlayerSettings.submitAnalytics {0}", value );
}
@elringus
elringus / BlendModes.c
Last active March 11, 2024 11:32
Popular blend mode algorithms implemented in Nvidia's Cg. https://elringus.me/blend-modes-in-unity/
fixed3 Darken (fixed3 a, fixed3 b)
{
return min(a, b);
}
fixed3 Multiply (fixed3 a, fixed3 b)
{
return a * b;
}