Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System;
using ProBuilder2.Common;
/**
using UnityEngine;
/**
* An empty script used to provide some reference for null components so that we can delete them.
*/
public class pb_DummyScript : MonoBehaviour {}
using UnityEditor;
using UnityEngine;
using System.Linq;
using ProBuilder2.Common;
using ProBuilder2.EditorCommon;
namespace ProBuilder2.Actions
{
/**
* Menu interface for manually re-generating all ProBuilder color arrays in scene.

ProBuilder 2.4.4f1 (r3385)

Features

  • Where possible* indices are now collapsed to share a single vertex.
  • Add context menu to swap between dockable window modes in vertex painter.
  • Unity 5.1 beta compatibility.
  • New Icosphere shape.
  • New API example shows a deformed icosphere with FFT spectrum.
  • Grow Selection is now roughly one gajillion times faster.
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using System.Collections;
using System.Linq;
[InitializeOnLoad]
public class HideShowCanvas : Editor
{
static HideShowCanvas()
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace ProBuilder2.Common
{
/**
* Simple object pool implementation.
*/
public class pb_ObjectPool<T> where T : UnityEngine.Object, new()
-- ProBuilder 2.4.8f0 (r3747)
# Features
- Enable Set Pivot, Delete, and Vertex Painter in ProBuilder Basic.
- New Standard Shader with vertex color support (thanks to Unity Forum user @defaxer).
# Bug Fixes
- Add tooltips for every action in the ProBuilder toolbar.
- Fix consistent horizontal scrollbar showing in ProBuilder window.
- Use white text color in Dimensions Overlay when Unity Personal skin is used.
using UnityEngine;
namespace ProBuilder2.Common
{
/**
* A generic singleton implementation for MonoBehaviours.
*/
public class pb_MonoBehaviourSingleton<T> : MonoBehaviour where T : MonoBehaviour
{
/// Store a static reference to the instance of this object.
@karl-
karl- / glErrorUtil
Last active December 19, 2015 05:28
void PrintGLError(char* previousCall)
{
GLenum err = glGetError();
if(err == GL_NO_ERROR)
return;
// TODO Clip previousCall to MAX_LENGTH
int prevCallLength = strlen(previousCall);
@karl-
karl- / ReplaceUV3Property.cs
Created December 23, 2015 17:22
Hack to access UV3 attribute as vec4 in ShaderForge
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
/**
* Provides a quick and dirty path to access a mesh.uv3 channel as Vector4 in ShaderForge