Skip to content

Instantly share code, notes, and snippets.

View Novack's full-sized avatar

Novack

View GitHub Profile
@Novack
Novack / PerformBuild.cs
Created August 11, 2019 02:27 — forked from jmcguirk/PerformBuild.cs
Unity3D Ant Build Configuration
// C# example
using UnityEditor;
using System.IO;
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
class PerformBuild
{
static string[] GetBuildScenes()
using UnityEditor;
using UnityEngine;
/// <summary>
/// Hierarchy window game object icon.
/// http://diegogiacomelli.com.br/unitytips-hierarchy-window-gameobject-icon/
/// </summary>
[InitializeOnLoad]
public static class HierarchyWindowGameObjectIcon
{
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Gist importer.
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class HierarchyWindowGroupHeader : Editor
{
static HierarchyWindowGroupHeader()
{
EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI;
}
@Novack
Novack / UnityAssetBundleBuilder.cs
Created June 14, 2019 19:15 — forked from tkyaji/UnityAssetBundleBuilder.cs
[Unity] Build Asset Bundle, and upload to AWS-S3
using UnityEngine;
using UnityEngine.Networking;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System;
@Novack
Novack / PlatformDefinesUnity.txt
Created June 4, 2019 12:34 — forked from yapetrichka/PlatformDefinesUnity.txt
Platform Custom Defines Unity
You can define your own preprocessor directives to control which code gets included when compiling.
To do this you must add a text file with the extra directives to the “Assets/” folder.
The name of the file depends on the language you are using, and the extension is .rsp:
C# - <Project Path>/Assets/smcs.rsp
C# - Editor Scripts <Project Path>/Assets/gmcs.rsp
UnityScript - <Project Path>/Assets/us.rsp
As an example, if you include the single line “-define:UNITY_DEBUG” in your smcs.rsp
file the define UNITY_DEBUG will exist as a global define for C# scripts,
@Novack
Novack / Unity-hotswapping-notes.md
Created May 30, 2019 01:09 — forked from cobbpg/Unity-hotswapping-notes.md
Unity hotswapping notes

Unity hotswapping notes

Unity has built-in support for hotswapping, which is a huge productivity booster. This feature works not only with graphics assets like bitmaps and meshes, but also with code: if you edit the source and save it, the editor will save the state of the running game, compile and load the new code, then load the saved state and continue where it left off. Unfortunately, this feature is very easy to break, and most available 3rd party plugins have little regard for it.

It looks like there’s a lot of confusion about hotswapping in Unity, and many developers are not even aware of its existence – which is no wonder if their only experience is seeing lots of errors on the console when they forget to stop the game before recompiling... This document is an attempt to clear up some of this confusion.

Nota bene, I’m not a Unity developer, so everything below is based on blog posts and experimentation. Corrections are most welcome!

The basic flow of hotswapping

@Novack
Novack / FeaturesAcceleratedSegmentTest.cs
Created May 8, 2019 21:06 — forked from unitycoder/FeaturesAcceleratedSegmentTest.cs
FAST Algorithm for Corner Detection (Unity)
// unity version : https://unitycoder.com/blog/2019/05/09/fast-algorithm-for-corner-detection-in-unity/
// NOTE this is not optimized in any way
// original source https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_fast/py_fast.html
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FeaturesAcceleratedSegmentTest : MonoBehaviour
@Novack
Novack / LayoutUtils.cs
Last active April 20, 2019 13:56 — forked from LotteMakesStuff/LayoutUtils.cs
Simple tool for importing editor layout files (.wlt files) from the asset folder. this is cool cos you can then share layouts with your team via source control
// put me in an Editor folder
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
public static class LayoutUtils
{
// unity stores layouts in a path referenced in WindowLayout.LayoutsPreferencesPath.
// Unfortunately, thats internal - well just creat the path in the same way they do!
@Novack
Novack / SplatMapToVertColors.cs
Created April 10, 2019 00:36 — forked from SkaillZ/SplatMapToVertColors.cs
Copy splat map to vertex colors
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace RoboticWeaselAssault.Gamutmamut.Editor
{
public class EditorTools
{
/// <summary>