Skip to content

Instantly share code, notes, and snippets.

View allanolivei's full-sized avatar

Allan Oliveira Marinho allanolivei

View GitHub Profile
@allanolivei
allanolivei / Unity3d - Basic Input Number Mask
Created October 8, 2021 11:23
Unity3d - Basic Input Number Mask
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
[RequireComponent(typeof(TMP_InputField))]
public abstract class InputValidator : MonoBehaviour
@allanolivei
allanolivei / IconManager
Created June 18, 2015 03:54
Unity 3d - IconManager
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public class IconManager {
public enum LabelIcon {
Gray = 0,
Blue,
@allanolivei
allanolivei / gist:9260107
Created February 27, 2014 21:38
Unity 3d : Get Selected Folder in Project Window
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
public static class UnityUtil
{
public static string GetSelectedPathOrFallback()
{
string path = "Assets";
@allanolivei
allanolivei / gist:9008439
Created February 14, 2014 20:19
Unity 3d : Generating atlas(Sprites) of selected images
using UnityEngine;
using UnityEditor;
using System.Collections;
public class AtlasGenerator {
//inseri no menu superior "Assets" a opcao de gerar um novo atlas das imagens selecionadas( Ctrl+Shift+C = %#c ) na raiz da pasta "Assets"
[MenuItem("Assets/GenerateAtlas %#c")]
static void Execute()
{
@allanolivei
allanolivei / gist:8982445
Last active March 26, 2022 20:14
Unity 3d : Expose the rendering order of MeshRenderer in the Unity3D
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System;
using UnityEditorInternal;
[CustomEditor(typeof(MeshRenderer)), CanEditMultipleObjects]
public class MeshRendererInspector : Editor
{