Skip to content

Instantly share code, notes, and snippets.

View bo11ox's full-sized avatar
🏴󠁧󠁢󠁳󠁣󠁴󠁿
:rage4:

Rainer Strobo bo11ox

🏴󠁧󠁢󠁳󠁣󠁴󠁿
:rage4:
  • FFM/Germany
View GitHub Profile
@LotteMakesStuff
LotteMakesStuff / LayoutUtils.cs
Last active November 2, 2023 21:04
Simple tool for importing editor layout files (.wlt files) from the asset folder. this is cool cos you can then share layouts with your team via source control
// put me in an Editor folder
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
public static class LayoutUtils
{
// unity stores layouts in a path referenced in WindowLayout.LayoutsPreferencesPath.
// Unfortunately, thats internal - well just creat the path in the same way they do!
@Jaykul
Jaykul / emojiprompt.ps1
Created May 7, 2019 17:19
An emoji prompt
function prompt {
if (Test-Success) {
$heart = "❤", "🧡", "💛", "💚", "💙", "💜", "💔", "💕", "💓", "💗", "💖", "💘", "💝" | Get-Random
"`e[107m`e[30mI${heart}PS`e[37m`e[49m" # that last character is the powerline >
} else {
$heart = "🧡", "💛", "💙", "🖤" | Get-Random
"`e[41m`e[37mI${heart}PS`e[31m`e[49m" # that last character is the powerline >
}
}
@unitycoder
unitycoder / ContinueCoroutine.cs
Created June 18, 2019 19:27
Continue CoRoutine After Gameobject was disabled and then enabled (with .setActive)
// example script for restarting Coroutine after gameobject was disabled (and continue from previous timer value)
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
public class ContinueCoroutine : MonoBehaviour
{
public float duration = 5f;
@sabresaurus
sabresaurus / PaletteWindow.cs
Last active September 27, 2023 19:50
Palette window with drag-drop boxes that you can drag common objects onto such as scenes, materials, prefabs to easily access them later (From SabreCSG originally)
// MIT License
//
// Copyright (c) 2021 Sabresaurus
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Froghut
Froghut / OdinWatchWindow.cs
Last active January 25, 2025 07:31
Odin Watch Window
#if ODIN_INSPECTOR
using System;
using System.Collections.Generic;
using System.Linq;
using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities;
using Sirenix.Utilities.Editor;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities;
using Sirenix.Utilities.Editor;
using UnityEditor;
public class DbBrowser : OdinMenuEditorWindow
{
[MenuItem("Db/Browser")]
public static void Open()
{
@Quickz
Quickz / VariableChangedEventPattern.cs
Created March 3, 2020 18:50
A generic variable wrapper that allows detecting value changes.
using System;
namespace VariableChangedEventPattern
{
class Program
{
private static void Main()
{
Game.Score.Changed += OnScoreChanged;
Game.Score.Value += 200;
@brihernandez
brihernandez / FloatingOrigin.cs
Last active February 21, 2025 01:01
Floating origin to handle large worlds in Unity.
// Based on the Unity Wiki FloatingOrigin script by Peter Stirling
// URL: http://wiki.unity3d.com/index.php/Floating_Origin
using UnityEngine;
using UnityEngine.SceneManagement;
public class FloatingOrigin : MonoBehaviour
{
[Tooltip("Point of reference from which to check the distance to origin.")]
public Transform ReferenceObject = null;
// Rebinding using InputSystem from Prokuv'o
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class Rebinder : MonoBehaviour
@mstevenson
mstevenson / .gitattributes
Last active March 6, 2023 16:31
Git configuration files for Unity projects
*.cs diff=csharp
# Macro attribute, linguist-generated means the file is ignored for the
# repository's language statistics and diffs are hidden by default
[attr]unity-yaml-file -text -merge=unityamlmerge linguist-generated
# Macro attribute for LFS files
[attr]lfs-file filter=lfs diff=lfs merge=lfs -text
### Unity YAML Files ###