Skip to content

Instantly share code, notes, and snippets.

View felipeggrod's full-sized avatar

Felipe Rodrigues felipeggrod

View GitHub Profile
@FlaShG
FlaShG / CorouTweenTest.cs
Last active August 26, 2022 00:56
Very simple Tweens for Unity using Coroutines.
using UnityEngine;
public class CorouTweenTest : MonoBehaviour
{
[SerializeField]
private Vector3 targetPosition;
[SerializeField]
private float duration = 1;
private void Start()
@luke161
luke161 / TreeNode.cs
Created May 11, 2017 10:10
Simple tree data structure for use with C# and Unity. Start with a root TreeNode and add children as required.
/**
* TreeNode.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
using System;
using System.Collections.Generic;
public class TreeNode<T>
{
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active September 17, 2024 08:43
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
@Seneral
Seneral / SerializableAction.cs
Last active July 7, 2021 14:01
Fully capable SerializableAction for Unity. Supports targets of both UnityEngine.Object and System.Object and one-layer serialization of unserializable types. Supports static and generic methods and classes; Supports most anonymous actions, fully capable of using the context. Support: forum.unity3d.com/threads/406299; Check for updates: https://…
namespace SerializableActionHelper
{
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Reflection;
@t0chas
t0chas / CustomEditorBase.cs
Last active September 2, 2024 06:54
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@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()
{
@jboner
jboner / latency.txt
Last active September 20, 2024 12:40
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD