Skip to content

Instantly share code, notes, and snippets.

View AGeorgy's full-sized avatar

George Ananchenko AGeorgy

View GitHub Profile
#define R 1.1
float wave(in vec2 uv, in vec2 center, in float radius) {
vec2 s = uv - center;
float r = length(s);
float h = sin(r * 50.0 + float(iFrame) / 10.0) * 0.1 * (radius - r);
if(r >= radius)
return 0.0;
else
return h;
@bddckr
bddckr / DestroySystem.cs
Last active February 15, 2017 19:12
A system to destroy entities in Entitas, for all pools
using System;
using System.Collections.Generic;
using System.Linq;
using Entitas;
public sealed class DestroySystem : ISetPools, IGroupObserverSystem
{
public GroupObserver groupObserver
{
get
@phosphoer
phosphoer / SimpleGeo.cs
Last active December 2, 2024 16:13
Simple Geometry Painter for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
using UnityEngine;
using System;
using System.Collections;
using RSG;
public partial class WaitManager {
private WaitManager () {
}
private static WaitManager _instance;
using UnityEngine;
using System.Collections;
public class CoroutineManager : MonoBehaviour {
private CoroutineManager () {
_instance = this;
}
private static CoroutineManager _instance;
@marcosecchi
marcosecchi / MenuItemGenerator.cs
Last active January 30, 2024 10:24
Generating menu items at runtime in Unity
using UnityEngine;
using UnityEditor;
using System.Text;
namespace TheBitCave {
public class MenuItemGenerator {
/// <summary>
/// Generates a list of menuitems from an array
/// </summary>
@aras-p
aras-p / ComputeOcclusionFromDepth.shader
Last active June 17, 2025 17:31
Unity command buffer that modifies screenspace shadow mask
Shader "Hidden/ComputeOcclusion"
{
Properties
{
_MainTex ("", 2D) = "white" {}
}
SubShader
{
Pass
{
@t0chas
t0chas / CustomDefines.cs
Created March 19, 2016 17:21
Manage your Unity3D symbols easily within the Editor by defining menu items
using UnityEngine;
using UnityEditor;
public class CustomDefines {
[MenuItem("Global Defines/My Symbol/Enable")]
public static void EnableDebug(){
Debug.LogWarning("Enabling MY_SYMBOL");
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
string newDefine = "MY_SYMBOL";
@jringrose
jringrose / FindProjectReferences.cs
Last active June 17, 2022 21:34
Unity editor extension that uses spotlight on OSX for lightning fast project reference searches. Asset serialization mode should be set to "Force Text" in the editor settings.
/*
MIT License
Copyright (c) 2016 Jesse Ringrose
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@aras-p
aras-p / OnlyShadowsAndAtten.shader
Created December 9, 2015 14:08
Shadows and Attenuation Only Shader
Shader "Custom/OnlyShadowsAndAtten"
{
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 200
// Forward rendering base (main directional light) pass.
Pass
{