Skip to content

Instantly share code, notes, and snippets.

View RGSMS's full-sized avatar

Rômulo Gomes de Souza Marques dos Santos RGSMS

View GitHub Profile
@yasirkula
yasirkula / ConvertTexturesToPNG.cs
Last active October 27, 2025 00:22
Convert all TGA, TIFF, PSD and BMP (customizable) Textures to PNG to reduce the project size without any quality loss in Unity
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
// Thanks to https://twitter.com/jon_barron/status/1318946131078909952
//
using UnityEngine;
public static class CurveUtils
{
// From pico8 example by @otikik
public static float BiasGain(float x, float s, float t)
{
@Ardaurum
Ardaurum / EditorObjectHighlight.cs
Last active May 9, 2021 18:20
`EditorObjectHighlight.cs` is the core that stores objects to highlight and renders them. There's also an `EditorObjectHighlight.shader` which is a transparent one color shader and can be easily extended. The `HighlightOnHover.cs` is an example usage of `EditorObjectHighlight`.
using System.Collections.Generic;
using UnityEngine;
namespace Ard.Tools
{
[InitializeOnLoad]
public static class EditorObjectHighlight
{
private static readonly List<HighlightObject> _highlights;
@jfranmora
jfranmora / ReadOnlyAttribute.cs
Last active November 22, 2023 16:12
Custom property attribute to make ReadOnly variables in Unity Inspector
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute
{
}
@karljj1
karljj1 / FadeGroupExample.cs
Last active November 17, 2020 17:45
How to make a IMGUI FadeGroup in UIElements
using UnityEditor;
using UnityEngine.UIElements;
using UnityEngine.UIElements.Experimental;
public class FadeGroupExample : EditorWindow
{
ValueAnimation<StyleValues> m_FoldoutAnimation;
VisualElement m_FadeGroup;
int m_AnimationTime = 500;
using System.Collections;
using UnityEngine;
/// <summary>
/// GC friendly coroutine utilities
/// @JfranMora #UnityTips
/// </summary>
public static class CoroutineUtils
{
public static IEnumerator WaitForSeconds(float seconds)
@HAliss
HAliss / CurveDissolve.shader
Last active June 7, 2022 17:26
Creates a monochromatic texture with color values from a given animation curve
Shader "Custom/CurveDissolve"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Noise("Noise", 2D) = "white" {}
_CurveTexture("Curve texture", 2D) = "white" {}
_Cutoff("Cutoff", Range(0,1)) = 0
_Glossiness ("Smoothness", Range(0,1)) = 0.5
@shanecelis
shanecelis / Renamer.cs
Last active June 10, 2019 15:28
Unity utility to rename game objects for use as headers in the scene hierarchy.
/* Original code[1] Copyright (c) 2019 Shane Celis[2]
Licensed under the MIT License[3]
[1]: https://gist.github.com/shanecelis/557b30f46b534a80047b9f2969a94c6e
[2]: https://github.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
using UnityEngine;
using UnityEditor;
using System;
using UnityEngine;
public static class Extensions_Math
{
// ...
public static float VectorToRad(this Vector2 thisVec){
return Mathf.Atan2(thisVec.y, thisVec.x);
@nagedev
nagedev / SingletonScriptable.cs
Last active October 23, 2018 12:06
SingletonScriptable
using System.Linq;
using UnityEditor;
using UnityEngine;
public abstract class SingletonScriptable<T> : ScriptableObject where T : ScriptableObject
{
static T _instance = null;
public static T instance
{
get