Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.AddressableAssets.Settings.GroupSchemas;
using UnityEditor.Build.Pipeline.Utilities;
@AsherVo
AsherVo / RequireReferenceAlert.cs
Last active October 26, 2020 04:03
Using unity's standard ObjectField in RequireReferenceDrawer to fix bugs and improve prefab workflow.
// PLEASE NOTE: This will add ~1sec to your save time
// If that is unacceptable (which it was to me), then you can change all the
// references to "MonoBehaviour" in this file to your own custom behaviour type
// that this script will search through each time you save
using UnityEditor;
using UnityEngine;
using System.Linq;
using System.Reflection;
using System.Collections;
@staggartcreations
staggartcreations / CinemachinePathShape.cs
Created January 5, 2020 08:51
Unity script for creating a circular, arched or spiraling cinemachine path
using UnityEngine;
using Cinemachine;
using Waypoint = Cinemachine.CinemachineSmoothPath.Waypoint;
public class CinemachinePathShape : MonoBehaviour
{
public CinemachineSmoothPath path;
[Space]
@DanielMPries
DanielMPries / XmlDocMd.ps1
Created December 11, 2019 02:11
Tool and task for Xml Doc Markdown
dotnet tool install xmldocmd -g
@karljj1
karljj1 / FadeGroupExample.cs
Last active November 17, 2020 17:45
How to make a IMGUI FadeGroup in UIElements
using UnityEditor;
using UnityEngine.UIElements;
using UnityEngine.UIElements.Experimental;
public class FadeGroupExample : EditorWindow
{
ValueAnimation<StyleValues> m_FoldoutAnimation;
VisualElement m_FadeGroup;
int m_AnimationTime = 500;
@tsubaki
tsubaki / ClickToEndBehaviour.cs
Last active May 12, 2021 10:41
UnityのTimel inで、クリックしたらクリップの末まで移動する
using UnityEngine;
using UnityEngine.Playables;
public class ClickToEndBehaviour : PlayableBehaviour
{
private PlayableDirector director { get; set; }
public override void OnPlayableCreate(Playable playable)
{
director = (playable.GetGraph().GetResolver() as PlayableDirector);
@keenanwoodall
keenanwoodall / UnityObjectOperatorOverloadTest.cs
Last active November 9, 2019 18:10
Test if the equality operator for anything that derives from Unity.Object is still overridden. Just put the script in your project and press play in any scene to test.
// read this article for more info: https://blogs.unity3d.com/2014/05/16/custom-operator-should-we-keep-it/
using UnityEngine;
public class UnityObjectOperatorOverloadTest : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod]
public static void Test()
{
var gameObject = new GameObject("UnityEngine.Object Operator Overload Test");
@syuji-higa
syuji-higa / Raymarching.shader
Last active November 16, 2019 03:58
Unity - Shader Raymarching
Shader "Unlit/Raymarching"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "Queue" = "Transparent" "RenderType" = "Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
@yasirkula
yasirkula / EditorCameraZoomWithScrollWheel.cs
Last active September 21, 2019 16:42
"Right mouse button+Scroll wheel" will continue to zoom in/zoom out the Scene View instead of changing the camera speed on Unity 2019+
#if UNITY_2019_1_OR_NEWER
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public class EditorCameraZoomWithScrollWheel
{
private const float CAMERA_SPEED = -0.25f;
private static bool rmbDown = false;
@keijiro
keijiro / borg-with-gs.md
Last active December 21, 2024 13:47
Using Borg and Google Cloud Storage for backing up personal projects

Why do you prefer [Borg] over [git-lfs]/[git-annex]?

  • GitHub LFS has a 2GB limit on file size. This never works with large projects like video productions.
  • git-annex uses symlinks to manage annexed files. This doesn't work well on Windows.

So my conclusion at the moment is that Borg is the best backup software for mid/large-sized personal projects.