Skip to content

Instantly share code, notes, and snippets.

#ifndef MAINLIGHT_INCLUDED
#define MAINLIGHT_INCLUDED
void GetMainLightData_float(out half3 direction, out half3 color, out half distanceAttenuation, out half shadowAttenuation)
{
#ifdef SHADERGRAPH_PREVIEW
// In Shader Graph Preview we will assume a default light direction and white color
direction = half3(-0.3, -0.8, 0.6);
color = half3(1, 1, 1);
distanceAttenuation = 1.0;
@wneee
wneee / LocalizeDropdown.cs
Created August 29, 2024 08:14 — forked from alisahanyalcin/LocalizeDropdown.cs
Unity Localize Dropdown Component
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;
using TMPro;
using UnityEditor;
public class LocalizeDropdown : MonoBehaviour
{
[SerializeField] private List<LocalizedString> dropdownOptions;
@wneee
wneee / DrawBones.cs
Last active March 13, 2024 04:17 — forked from codewings/DrawBones.cs
Display bones in Unity Editor
using UnityEngine;
[ExecuteInEditMode]
public class DrawBones : MonoBehaviour
{
#if UNITY_EDITOR
public bool ShowHierarchyAlwyas = true;
public bool ShowSelectedBoneName = true;
public Color BoneColor = Color.white;
public Color SelectedBoneColor = Color.red;
@wneee
wneee / RenderFeatureActive.cs
Last active March 11, 2024 07:21
The first script allows you to manage multiple Renderer Features. The second script is designed to individually enable the Renderer Feature using SetActive()
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.Universal;
[ExecuteAlways]
public class RenderFeatureActive : MonoBehaviour
{
[SerializeField]
private List<ScriptableRendererFeature> renderFeatures = new List<ScriptableRendererFeature>();
[SerializeField]