Skip to content

Instantly share code, notes, and snippets.

View maximetinu's full-sized avatar
🌔
🔭

Miguel Medina Ballesteros maximetinu

🌔
🔭
View GitHub Profile
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Unity5]
@=""
"Icon"="%ProgramFiles%\\Unity\\Editor\\Unity.exe"
"MUIVerb"="Open as Unity Project"
[HKEY_CLASSES_ROOT\Folder\shell\Unity5\Command]
@="cmd /c start /D\"c:\\Program Files\\Unity\\Editor\\\" Unity.exe -projectPath \"%1\""
public static class NullableComponentExtensions
{
public static UnityEngine.Component GetComponentIfNotNull( this UnityEngine.Component self, System.Type type )
{
if ( self == null )
{
return default( UnityEngine.Component );
}
return self.GetComponent( type );
}
@nonathaj
nonathaj / UnitySingleton.cs
Last active May 28, 2020 19:55
Generic UnitySingleton class for creating different types of singletons in Unity
using UnityEngine;
using System;
using System.Collections;
/// <summary>
/// Class for holding singleton component instances in Unity.
/// </summary>
/// <example>
/// [UnitySingleton(UnitySingletonAttribute.Type.LoadedFromResources, false, "test")]
/// public class MyClass : UnitySingleton&lt;MyClass&gt; { }
@rasteron
rasteron / Emboss.glsl
Created September 3, 2015 03:53
Simple Emboss Effect
#include "Uniforms.glsl"
#include "Samplers.glsl"
#include "Transform.glsl"
#include "ScreenPos.glsl"
varying vec2 vScreenPos;
varying vec2 vTexCoord;
varying vec4 vColor;
uniform float pixelWidth = 1024.0;
@bkaradzic
bkaradzic / orthodoxc++.md
Last active May 23, 2025 11:06
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@mandarinx
mandarinx / CustomHierarchyMenuItems.cs
Created April 3, 2016 15:27
Unity hierarchy tools
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.Collections.Generic;
/// <summary>
/// A collection of useful shortcuts for manipulating the hierarchy in Unity.
/// Some of this was written by me (@adamgryu), some of it was collected from random Unity forums and StackOverflow.
/// Feel free to use any of this code freely, without any restrictions or references.
/// Tested with Unity 5.3.3.
@nemotoo
nemotoo / .gitattributes
Last active May 22, 2025 06:54
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@mathiassoeholm
mathiassoeholm / TubeRenderer.cs
Last active March 28, 2025 02:50
Similar to Unity's LineRenderer, but renders a cylindrical mesh.
// Author: Mathias Soeholm
// Date: 05/10/2016
// No license, do whatever you want with this script
using UnityEngine;
using UnityEngine.Serialization;
[ExecuteInEditMode]
public class TubeRenderer : MonoBehaviour
{
[SerializeField] Vector3[] _positions;
@ProfPollati
ProfPollati / LaunchDuplicator.cs
Created November 5, 2016 19:45
Unity Editor script for class used for launching a duplicate instance of the project. Useful for testing multiplayer.
#if UNITY_EDITOR
// You'll need to include compiler conditions to only compile this if this is going through the Unity Editor, otherwise, you will not be able to compile a Build!
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using System.IO;
using System.Diagnostics;
public class LaunchDuplicator : EditorWindow {
@RyanNielson
RyanNielson / TransformEditor2D.cs
Last active February 3, 2020 11:23
A custom Inspector for Unity's Transform component to make it nicer when working on 2D games.
using UnityEngine;
using UnityEditor;
[CanEditMultipleObjects, CustomEditor(typeof(Transform))]
public class TransformEditor2D : Editor
{
public override void OnInspectorGUI()
{
Transform transform = (Transform)target;