Skip to content

Instantly share code, notes, and snippets.

View marcosecchi's full-sized avatar

Marco Secchi marcosecchi

View GitHub Profile
@marcosecchi
marcosecchi / HierarchyUtils.cs
Created May 6, 2016 08:35
Check if the current selection is in the Unity3D Hierarchy Panel
using UnityEngine;
using UnityEditor;
public class HierarchyUtils {
/// <summary>
/// Determines if the current selection in the Hierarchy view.
/// </summary>
/// <returns><c>true</c> if is selection in hierarchy; otherwise, <c>false</c>.</returns>
private static bool IsSelectionInHierarchy() {
@marcosecchi
marcosecchi / MenuItemGenerator.cs
Last active January 30, 2024 10:24
Generating menu items at runtime in Unity
using UnityEngine;
using UnityEditor;
using System.Text;
namespace TheBitCave {
public class MenuItemGenerator {
/// <summary>
/// Generates a list of menuitems from an array
/// </summary>