Skip to content

Instantly share code, notes, and snippets.

@cfazilleau
cfazilleau / AreaEffector2DVisualizer.cs
Created November 13, 2023 16:34
Simple Visualizer for the AreaEffector2D component in unity
using UnityEngine;
[ExecuteAlways]
[RequireComponent(typeof(AreaEffector2D))]
public class AreaEffector2DVisualizer : MonoBehaviour
{
public float length = 5f;
public float arrowSize = 1f;
public Color color = new Color(1f, .5f, 0f);
@cfazilleau
cfazilleau / UnrealSimulatorEditor.cs
Last active July 15, 2022 19:09
Simulate Unreal engine in Unity (just shows the "LIGHTING NEEDS TO BE REBUILT" in the top left corner of the viewport.) based on an original idea by Kenney (https://github.com/KenneyNL/Unreal-Simulator-for-Unity) but this time, it is just a 23 lines editor script, and not a full package with prefabs, assets, etc...
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class UnrealSimulator : Editor
{
private static GUIStyle style = null;
private const string text = "LIGHTING NEEDS TO BE REBUILT (4 unbuilt object(s))";
private const string subtext = "'DisableAllScreenMessages' to suppress";
Shader "Custom/SeeThrough"
{
Properties
{
[HideInInspector]
_MainTex ("Sprite Texture", 2D) = "white" {}
_GhostColor ("See-through Color", Color) = (0.2, 0.2, 0.2, 1)
}
SubShader