Skip to content

Instantly share code, notes, and snippets.

View Novack's full-sized avatar

Novack

View GitHub Profile
@Novack
Novack / Code.gs
Created December 5, 2019 18:30 — forked from rheajt/Code.gs
google apps script to open a new website in a new window
function openTab() {
var selection = SpreadsheetApp.getActiveSheet().getActiveCell().getValue();
var html = "<script>window.open('" + selection + "');google.script.host.close();</script>";
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Tab');
}
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class HideSceneToolbar
{
[MenuItem("Test/Hide the scene toolbar")]
static void Hide()
{
var sceneViews = Resources.FindObjectsOfTypeAll<SceneView>();
@Novack
Novack / PhysicsTool.cs
Created August 26, 2019 03:17 — forked from LotteMakesStuff/PhysicsTool.cs
In Unity 2019.1 Unity added a new custom EditorTool API, heres some example code showing some tools we could make with it!
// Put me in an editor folder!
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;
[EditorTool("PhysicsDrop Tool", typeof(Rigidbody))]
public class PhysicsTool : EditorTool
@Novack
Novack / LookatTool.cs
Created August 26, 2019 03:17 — forked from LotteMakesStuff/LookatTool.cs
In Unity 2019.1 Unity added a new custom EditorTool API, heres some example code showing some tools we could make with it!
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;
[EditorTool("LookAt Tool")]
public class LookatTool : EditorTool
{
GUIContent cachedIcon;
// NOTE: as were caching this, unity will serialize it between compiles! so if we want to test out new looks,
@Novack
Novack / gist:211d8d08ed9913745798cdcec49d47a7
Created August 21, 2019 05:21 — forked from anonymous/gist:4169590
Get Google Spreadsheet as PDF with customizations
function spreadsheetToPDF(key) {
var oauthConfig = UrlFetchApp.addOAuthService("spreadsheets");
var scope = "https://spreadsheets.google.com/feeds"
oauthConfig.setConsumerKey("anonymous");
oauthConfig.setConsumerSecret("anonymous");
oauthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
oauthConfig.setAuthorizationUrl("https://accounts.google.com/OAuthAuthorizeToken");
oauthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
@Novack
Novack / InspectorShortcuts.cs
Created August 19, 2019 02:10 — forked from VoxelBoy/InspectorShortcuts.cs
Lets you switch between Normal and Debug modes AND flip the Locked state of Inspectors with keyboard shortcuts (Shift+Alt+D for Normal/Debug modes and Shift+Alt+L for Flipping Locked state)
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
public static class InspectorShortcuts
{
public static BindingFlags FullBinding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
@Novack
Novack / EnumDescription.cs
Created August 18, 2019 02:01 — forked from Paul-JanPauptit/EnumDescription.cs
Unity sample MonoBehaviour explaining how to associate simple strings with enums.
using System;
using System.ComponentModel;
using UnityEngine;
public class EnumDescription : MonoBehaviour
{
public enum PlayerState
{
Unknown,
[Description("Alive and kicking")]
@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.