Skip to content

Instantly share code, notes, and snippets.

@calderarchinuk
calderarchinuk / PackageCreatorWindow.cs
Last active August 21, 2023 00:56
A simple Unity editor window that will create the folders and files for a upm package
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
//this script creates the folder structure and critical files to define a unity UPM package
//it also includes basic script templates for testing and editor tools
//just throw this into Assets/Editor folder and select Tools/Package Creator Window
//for a more fully featured package creation script, try https://github.com/jeffcampbellmakesgames/unity-package-tools
@calderarchinuk
calderarchinuk / blender-to-unity-fbx-exporter-multi.py
Last active November 29, 2020 23:31
fork of https://github.com/EdyJ/blender-to-unity-fbx-exporter. added option to export each object to a separate file
bl_info = {
"name": "Unity FBX format",
"author": "Angel ""Edy"" Garcia (@VehiclePhysics)",
"version": (1, 2, 3),
"blender": (2, 80, 0),
"location": "File > Export > Unity FBX",
"description": "FBX exporter compatible with Unity's coordinate and scaling system.",
"warning": "",
"wiki_url": "",
"category": "Import-Export",
@calderarchinuk
calderarchinuk / UnityAssistant.cs
Last active December 8, 2023 09:50
Unity Editor Assistant. Adds a context-sensitive right-click menu, automatically disables auto-generate lightmaps
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
using UnityEditor.SceneManagement;
[InitializeOnLoad]
public class UnityAssistant
{
@calderarchinuk
calderarchinuk / UnrealCameraMovement.cs
Created January 16, 2020 02:09
unreal camera controls in unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
//TODO clamp pitch rotation
//TODO y axis rotation is offset forward slightly, not at scene camera position
//TODO sometimes doesn't register mouse up/down events. should poll every frame? for mouse button state
public class UnrealCameraMovement : EditorWindow
@calderarchinuk
calderarchinuk / AssetBrowser.cs
Last active November 4, 2020 05:30
window to import common local files into project
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
//TODO asset tags
//TODO asset dependencies (auto import)
//TEST manifest.json gets generated correctly
@calderarchinuk
calderarchinuk / Nexus5BuildSettings.cs
Created May 28, 2019 02:08
sets common project/build settings for android
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
public class Nexus5BuildSettings
{
const string CompanyName = "CompanyName";
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(CubicBezierPath))]
public class CubicBezierEditor : Editor
{
void OnSceneGUI()
{
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
//sorts children in selected transform in alphabetical order
public class SortChildrenMenuItem
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
//shift x,y,z to move along axis
//TODO apply movement to each selected object
//BUG scene view needs to be focused to detect mouse movements
public class MouseMoveWindow : EditorWindow
using UnityEngine;
public class GizmoRaycastToGround : MonoBehaviour {
void OnDrawGizmos()
{
RaycastHit hit = new RaycastHit();
if (Physics.Raycast(transform.position,Vector3.down,out hit))
{
Gizmos.DrawWireCube(hit.point, new Vector3(0.1f, 0, 0.1f));