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
using UnityEngine;
using System.IO;
using System;
public static class RenderTextureExtensions
{
private static DefaultDictionary<RenderTexture, Texture2D> _cachedTextures = new DefaultDictionary<RenderTexture, Texture2D>();
@unitycoder
unitycoder / CustomImportProcessor.cs
Created February 27, 2023 07:02
Read FBX Custom Properties (Unity Editor Script AssetPostprocessor)
// https://forum.unity.com/threads/how-to-import-user-defined-attributes-from-fbx-files.409877/
using UnityEngine;
using UnityEditor;
using System.IO;
class CustomImportProcessor : AssetPostprocessor {
void OnPostprocessGameObjectWithUserProperties(GameObject go, string[] names, System.Object[] values) {
ModelImporter importer = (ModelImporter)assetImporter;
var asset_name = Path.GetFileName(importer.assetPath);
Debug.LogFormat("OnPostprocessGameObjectWithUserProperties(go = {0}) asset = {1}", go.name, asset_name);
@Anthelmed
Anthelmed / WorldSpaceUIDocument.cs
Last active November 7, 2024 07:31
Until Unity decide to make it official, this is a custom WorldSpaceUIDocument component. Code is under the MIT license: https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
using UnityEngine.UIElements;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem.UI;
#endif
#if UNITY_EDITOR
using UnityEditor;
@mtvee
mtvee / windowscpp.md
Created October 3, 2022 02:11
c++ from command line in windows

How to build c++ from the command line in windows 10

The rest of all this is done from the shell and any editor

  • make a junk directory somewhere and put these files into it
@addie-lombardo
addie-lombardo / DiceLuaCommands.cs
Created August 4, 2022 04:43
A robust dice roll Lua command for Dialogue System for Unity
// Requires Dialogue System for Unity: https://www.pixelcrushers.com/dialogue-system/
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Security.Cryptography;
using PixelCrushers.DialogueSystem;
using UnityEngine;
/// <summary>
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Breakable : MonoBehaviour
{
public float mass = 50;
public float impulseThreshold = 10000;
Collider _collider;
@herohiralal
herohiralal / Archetype.cs
Created February 15, 2022 04:03
HiraBots sample 1
using UnityEngine;
using UnityEngine.AI;
namespace AIEngineTest
{
public class Archetype : MonoBehaviour,
IHiraBotArchetype<NavMeshAgent>,
IHiraBotArchetype<Animator>,
IHiraBotArchetype<ConsolidatedSensor>,
IHiraBotArchetype<HiraLGOAPRealtimeBot>,
@CharStiles
CharStiles / unityStickerSheet.shader
Created October 5, 2021 21:57
Unity shader sticker sheet
// Tips for converting GLSL functions to Unity functions
// vec turn into float (usually massive comand all replace works)
// fract -> frac
// mod -> modf
// time, iTime, u_Time -> _Time.y
float3 hsv2rgb(float3 c) {
c = float3(c.x, clamp(c.yz, 0.0, 1.0));
float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
Shader "Custom/swirl"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AlansBlendShapeClipVowels : MonoBehaviour
{
[Range(0f, 1f)] public float A;
[Range(0f, 1f)] public float E;
[Range(0f, 1f)] public float I;
[Range(0f, 1f)] public float O;