Skip to content

Instantly share code, notes, and snippets.

// https://forum.unity.com/threads/clear-old-texture-references-from-materials.318769/
#define UPDATING_FLOAT_TO_INT
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class MaterialPropertyCleaner : EditorWindow {
private const float REMOVE_BUTTON_WIDTH = 60;
@rutcreate
rutcreate / InspectorEditor.cs
Last active October 28, 2022 14:30
Unity3D: How to iterate properties through inspector
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace Opendream {
[CustomEditor(typeof(MovingPlatform))]
public class InspectorEditor : Editor {
public override void OnInspectorGUI() {
@gitaarik
gitaarik / git_submodules.md
Last active April 13, 2025 18:24
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@bzgeb
bzgeb / TriggerContainerEditor.cs
Created September 28, 2012 14:52
Example Drag & Drop area in a custom inspector for the Unity editor
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;