Skip to content

Instantly share code, notes, and snippets.

View Novack's full-sized avatar

Novack

View GitHub Profile
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditorInternal;
#endif
@Novack
Novack / CustomHierarchyView.cs
Created April 12, 2017 14:21 — forked from ilkinulas/CustomHierarchyView.cs
editor script that demonstrates how to customize hierarchy window
using UnityEngine;
using UnityEditor;
using System.Text;
[InitializeOnLoad]
public class CustomHierarchyView {
private static StringBuilder sb = new StringBuilder ();
static CustomHierarchyView() {
@Novack
Novack / Unity-GetAllFilesUnderSelectedFoder.cs
Created April 12, 2017 15:40 — forked from kimsama/Unity-GetAllFilesUnderSelectedFoder.cs
Code snip which shows gather all files under selected folder in Unity's Project View
/// <summary>
/// Retrieves selected folder on Project view.
/// </summary>
/// <returns></returns>
public static string GetSelectedPathOrFallback()
{
string path = "Assets";
foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets))
{
@Novack
Novack / GetAssetsOfType.cs
Created April 12, 2017 15:43 — forked from kimsama/GetAssetsOfType.cs
Retrieves certain type of assets with the specified file extension at the given path.
/// <summary>
/// Used to get assets of a certain type and file extension from entire project
/// Usage:
/// UnityEngine.Object[] pagePrefabs = GetAssetsOfType("Resources/Prefabs/PAGE", typeof(GameObject), ".prefab");
/// </summary>
/// <param name="type">The type to retrieve. eg typeof(GameObject).</param>
/// <param name="fileExtension">The file extention the type uses eg ".prefab".</param>
/// <returns>An Object array of assets.</returns>
public static UnityEngine.Object[] GetAssetsOfType(string path, System.Type type, string fileExtension)
{
@Novack
Novack / Docker.cs
Created April 13, 2017 17:57 — forked from Thundernerd/Docker.cs
Helper to dock EditorWindows
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class Docker
{
#region Reflection Types

How to Use?

GUIStyle mystyle = new GUIStyle("some string from the list below");


UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"
using System;
using UnityEngine;
using UnityEditor;
public class SelectObjWithGID : EditorWindow
{
string myString = "";
bool groupEnabled;
bool myBool = true;
float myFloat = 1.23f;
#if UNITY_EDITOR
using System.Reflection;
using UnityEngine;
using UnityEditor;
public class FontSwitcher : EditorWindow
{
[MenuItem("Font/Show Window")]
public static void ShowFontWindow()
{
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class GraphEditorWindow : EditorWindow
{
Rect windowRect = new Rect(200f, 200f, 200f, 300f);
Rect windowRect2 = new Rect(100f, 100f, 200f, 300f);
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Hidden/Internal-GUITextureClipText"
{
Properties { _MainTex ("Texture", 2D) = "white" {} }
CGINCLUDE
#pragma vertex vert
#pragma fragment frag