Skip to content

Instantly share code, notes, and snippets.

@Baste-RainGames
Baste-RainGames / DragAndDropService.cs
Last active May 31, 2022 06:04
Interaction with Unity's DragAndDropService
using System;
using System.Reflection;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
// This class gives access to Unity's internal DragAndDropService class through reflection, and exposes the same methods.
// See https://github.com/Unity-Technologies/UnityCsReference/blob/f50ab75c509cab05254e0ff2f06eb74f5ecd30da/Editor/Mono/DragAndDropService.cs
namespace RainDragAndDropService {
public static class DragAndDropService {
@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@keijiro
keijiro / ToggleTest.shader
Last active March 24, 2023 00:43
Shows how to use the Toggle material property drawer in a shader. See the reference manual for further details: http://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html
Shader "ToggleTest"
{
Properties
{
[Toggle(FILL_WITH_RED)]
_FillWithRed ("Fill With Red", Float) = 0
}
SubShader
{
Pass
@dkalamari
dkalamari / gist:10963821
Created April 17, 2014 08:17
WPF TextBox focus through MVVM
<Style x:Key="NormalTextBox" TargetType="{x:Type TextBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsFocused}" Value="True">
<Setter Property="FocusManager.FocusedElement"
Value="{Binding RelativeSource={RelativeSource Self}}" />
</DataTrigger>
</Style.Triggers>
</Style>