Skip to content

Instantly share code, notes, and snippets.

View WildRikku's full-sized avatar

Wild Rikku WildRikku

View GitHub Profile
@FreyaHolmer
FreyaHolmer / SceneViewZAlign.cs
Last active November 27, 2023 11:32
Allows the scene view camera to use Z up/down (be sure to place this script in an Editor/ folder)
// Allows you to change the up vector in the scene view to the Z axis.
// Y-up mode uses Unity's default implementation.
//
// Original code from Akulist on the Unity forums, modified by Freya Holmér:
// • Fixed orbit+RMB zoom not working
// • Toggling will now align the camera immediately to the new up vector
// • When the camera is upside down in Z axis mode, left/right orbit will no longer be mirrored (pls fix this too Unity~)
// • Moved toggle buttons to under the gizmo
// • Fixed broken rotation state when focusing a different window in Unity and coming back to the scene view
//
@yasirkula
yasirkula / EditorCollapseAll.cs
Last active March 11, 2024 11:53
An editor script for Unity 3D to collapse all GameObject's in Hierarchy view or to collapse all folders in Project view. See the comments section below for instructions.
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using UnityEngine.SceneManagement;
public static class EditorCollapseAll
{
private const BindingFlags INSTANCE_FLAGS = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;