Skip to content

Instantly share code, notes, and snippets.

nulldiver nulldiver

Block or report user

Report or block nulldiver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nulldiver
nulldiver / TestEditorThingy.cs
Last active Nov 11, 2017
Proof of concept on marking inspector with locked info
View TestEditorThingy.cs
using System.Reflection;
using UnityEditor;
using UnityEngine;
// Quickly yanked from a test project and tested in Unity 5.4.3
// Original credit for the "reflect to get isLocked and draw a HelpBox" idea lies elswhere... can't remember where.
// You probably don't really want to do this as a CustomEditor for Transform, but it gets the point across quickly.
[CanEditMultipleObjects]
[CustomEditor(typeof(Transform))]
@nulldiver
nulldiver / LayoutArea.cs
Last active Aug 26, 2017
using scope to make quick OnGUI layouts easier.
View LayoutArea.cs
public void OnGUI()
{
using (new LayoutArea(LayoutType.Vertical))
{
using (new LayoutArea(LayoutType.Horizontal))
{
GUILayout.Label("First");
GUILayout.Label("Line");
}
using (new LayoutArea(LayoutType.Horizontal))
@nulldiver
nulldiver / RandomizeSceneMode.cs
Last active Nov 11, 2017
Mostly showing playmodeStateChanged delegates and SceneView.rendermode
View RandomizeSceneMode.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
// If, for example, you wanted a different random render mode every time anything about your playmode state changed...
[InitializeOnLoad]
public class RandomizeSceneMode {
static RandomizeSceneMode() {
EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
}
private static void PlaymodeStateChanged () {
View keybase.md

Keybase proof

I hereby claim:

  • I am nulldiver on github.
  • I am nulldiver (https://keybase.io/nulldiver) on keybase.
  • I have a public key whose fingerprint is D667 51E8 DEB3 5A55 3246 CCB7 1DE7 42E2 125E 91BF

To claim this, I am signing this object:

You can’t perform that action at this time.