Skip to content

Instantly share code, notes, and snippets.

View rob5300's full-sized avatar
🙃
Trying out new things

Robert rob5300

🙃
Trying out new things
View GitHub Profile
@FreyaHolmer
FreyaHolmer / AssetCopyUtils.cs
Last active June 12, 2024 07:25
Adds context menu items to assets: Copy/Paste import settings & Copy GUID. Put this script in any Editor/ folder in your project and recompile!
// written by https://github.com/FreyaHolmer so use at your own risk c:
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/// <summary>Utility functions to copy GUIDs, as well as Copy/Paste import settings</summary>
public static class AssetCopyUtils {
const int CTX_MENU_LOCATION = 70;
@rob5300
rob5300 / bzipall.py
Created November 22, 2020 16:23
BZip each file into its own archive and save into new folder structure. Useful for Source/TF2 server files to download
# BZipAll script to quickly bzip all files in a directory.
# Made by rob5300
# FILL ME IN!!! THIS MAY NOT BE RIGHT FOR YOU!!
# Full path to your 7z.exe executable from your 7z install. Plz download or install it if you need from 7-zip.org
_7zpath = r"C:\Program Files\7-Zip\7z.exe"
#Extensions to ignore
ignore = [".py", ".sp", ".smx", ".bz2"]
@rob5300
rob5300 / CanvasEditorHelper.cs
Created August 21, 2019 14:26
Applies preset layermask on scene open and restores it on scene closed. Made for use in custom ui prefab editing scenes to show the UI layer automatically.
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
/// <summary>
/// Applies preset layermask on scene open and restores it on scene closed.
/// Made for use in custom ui prefab editing scenes to show the UI layer automatically.
/// </summary>
[ExecuteInEditMode]
public class CanvasEditorHelper : MonoBehaviour
@KenneyNL
KenneyNL / CircularMenu.cs
Last active June 23, 2022 19:41
Circular menu sample code for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CircularMenu : MonoBehaviour{
public float radius = 100.0f;
public float offset = 0.0f;
void Start(){
Texture2D[] layers;
Texture2D compiledTexture = new Texture2D(layers[0].width, layers[0].height);
foreach(Texture2D layer in layers){
Color[] baseColors = compiledTexture.GetPixels();
Color[] layerColors = layer.GetPixels();
for(int p = 0; p < baseColors.Length; p++){
@RDeluxe
RDeluxe / BundleManager.cs
Last active August 15, 2018 09:44
BundleManager
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using AssetBundles;
using UnityEngine;
public class BundlesManager {
private static BundlesManager _instance;
private Dictionary<string, AssetBundle> _assetBundles;
private Dictionary<string, Task<AssetBundle>> _loadingAssetBundles;
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Collections.Generic;
using System.IO;
// Scene selection
@LotteMakesStuff
LotteMakesStuff / PlayerLoop.cs
Last active March 25, 2024 02:38
Player Loop Visualizer: Built to explore the new PlayerLoopSystem api in Unity 2018.1b2. This tool shows you all the PlayerLoop systems that unity uses to update a frame, and demos how to add your own and even remove systems from the player loop. For more info see the patreon post https://www.patreon.com/posts/unity-2018-1-16336053
// Put this in an editor folder
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Profiling;
// c# companion script
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- //
// Save you your project, add to your SpriteRenderer gameObject
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[ExecuteInEditMode]
@cortvi
cortvi / !Refractive Surface Shader.md
Last active March 31, 2022 22:55
Custom refractive liquid surface shader
We couldn’t find that file to show.