Skip to content

Instantly share code, notes, and snippets.

View danielbierwirth-unity's full-sized avatar

danielbierwirth danielbierwirth-unity

View GitHub Profile
@danielbierwirth-unity
danielbierwirth-unity / DisableMeshRenderer.cs
Created May 5, 2022 07:18
Create small menu entry to disable all mesh renderers attached to a GO - use this for collision meshes
[MenuItem("MyTools/DisableMeshRenderer")]
static void ApplyToSelected()
{
Debug.Log("Apply to selected");
GameObject[] selectedObjects = Selection.gameObjects;
foreach (GameObject obj in selectedObjects)
{
if (obj.GetComponent<MeshRenderer>() != null) {
obj.GetComponent<MeshRenderer>().enabled = false;
}
@danielbierwirth-unity
danielbierwirth-unity / CreateMeasuredMaterials.cs
Created March 29, 2021 17:22
small editor util - right click create measured materials shortcut for Unity Measured Materials Library
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace com.Unity.Industrial.Tools
{
/// <summary>