Skip to content

Instantly share code, notes, and snippets.

View Novack's full-sized avatar

Novack

View GitHub Profile
@Novack
Novack / EditorNote.cs
Created May 25, 2020 19:26 — forked from gekidoslair/EditorNote.cs
Add to any gameobject to provide scene-view annotations
using UnityEditor;
using UnityEngine;
namespace PixelWizards.Utilities
{
public class EditorNote : MonoBehaviour
{
[TextArea]
public string m_Text;
public Vector3 m_Offset;
@Novack
Novack / UnityLoader.js
Created April 23, 2020 18:22 — forked from kyptov/UnityLoader.js
without gzip and brotli decompressors
var UnityLoader = UnityLoader || {
Compression: {
identity: {
require: function() {
return {};
},
decompress: function(data) {
return data;
},
hasUnityMarker: function() {
@Novack
Novack / SmoothGameCameraMovement.cs
Created February 12, 2020 00:03 — forked from IRCSS/SmoothGameCameraMovement.cs
Unity Camera Movement in Game view like Scene View with filtering
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Moves Camera similar to how camera is moved in the Unity view port. Drop the scrip on the game object which has the camera and you wish to move.
public class SmoothGameCameraMovement : MonoBehaviour
{
public float lateralSpeed = 0.0015f;
@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")]