Skip to content

Instantly share code, notes, and snippets.

@ArieLeo
ArieLeo / RXLookingGlass.cs
Created February 6, 2025 19:15 — forked from MattRix/RXLookingGlass.cs
This class wraps an internal Unity method that lets you to check if a ray intersects a mesh. Place it in an Editor folder.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
using System.Linq;
using System.Reflection;
[InitializeOnLoad]
public class RXLookingGlass
{
@ArieLeo
ArieLeo / AutoFitBoxCollider.cs
Created July 26, 2024 09:20
Autofit Box collider to Mesh Renderer Bounds, usefull when you are trying to adjust box collider on multiple objects at once
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
public static class AutoFitBoxCollider
{
[MenuItem("Tools/Autofit BoxCollider")]
private static void AutoFitBoxCollider()
{
var gos = Selection.gameObjects;
@ArieLeo
ArieLeo / MeshExtensions.cs
Created February 13, 2024 15:23 — forked from Doprez/MeshExtensions.cs
Get Vertices and Indices from a mesh in Stride3d
using Stride.Games;
using Stride.Rendering;
using System;
using Stride.Core.Serialization;
using Stride.Core;
using Stride.Physics;
using System.Collections.Generic;
using Stride.Core.Mathematics;
public static class MeshExtensions
@ArieLeo
ArieLeo / YourGameDefinition.cs
Created February 13, 2024 15:21 — forked from Eideren/YourGameDefinition.cs
How to setup async shader compilation in stride, note that the game will still freeze initially to compile the fallback
public class YourGameDefinition : Stride.Engine.Game
{
protected override void BeginRun()
{
base.BeginRun();
foreach( var feature in SceneSystem.GraphicsCompositor.RenderFeatures )
{
if( feature is MeshRenderFeature meshRf )
{
meshRf.ComputeFallbackEffect += FallbackForAsyncCompilation;
@ArieLeo
ArieLeo / AnimationEvent.cs
Created February 9, 2024 13:58 — forked from Doprez/AnimationEvent.cs
Stride Animation event trigger
using ImmoApocalypse.Code.Core.Structs;
using Stride.Core;
using Stride.Engine;
using System;
using System.Windows.Media.Animation;
namespace Core;
[DataContract(nameof(AnimationEvent))]
[AllowMultipleComponents]
@ArieLeo
ArieLeo / RenderObjectsPass.cs
Created September 27, 2023 13:44 — forked from wonkee-kim/RenderObjectsPass.cs
Unity URP sample -RenderObjects's RenderPass
using System.Collections.Generic;
using UnityEngine.Rendering.Universal;
using UnityEngine.Rendering;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Rendering.Universal
{
[MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] public class RenderObjectsPass : ScriptableRenderPass
{
RenderQueueType renderQueueType;
@ArieLeo
ArieLeo / RenderObjects.cs
Created September 27, 2023 13:44 — forked from wonkee-kim/RenderObjects.cs
Unity URP sample -RenderObjects's RendererFeature
using System.Collections.Generic;
using UnityEngine.Rendering.Universal;
using UnityEngine.Rendering;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Experimental.Rendering.Universal
{
[MovedFrom("UnityEngine.Experimental.Rendering.LWRP")]public enum RenderQueueType
{
Opaque,
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class getBonesPath : MonoBehaviour {
public Transform obj;
public AnimationClip _clip;
public bool isOn;
@ArieLeo
ArieLeo / Outline.shader
Created June 8, 2023 09:38 — forked from ScottJDaley/Outline.shader
Wide Outlines Renderer Feature for URP and ECS/DOTS/Hybrid Renderer
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more
// by @gravitonpunch for ECS/DOTS/HybridRenderer.
// https://twitter.com/bgolus
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
Shader "Hidden/Outline"
{
Properties
@ArieLeo
ArieLeo / Lightbeam.shader
Created May 30, 2023 11:31
UDN Lightbeam Shader converted to Unity
Shader "Lightbeam/Lightbeam" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Width ("Width", Float) = 8.71
_Tweak ("Tweak", Float) = 0.65
}
SubShader {
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True"}
Pass {