Skip to content

Instantly share code, notes, and snippets.

View AGeorgy's full-sized avatar

George Ananchenko AGeorgy

View GitHub Profile
@amowu
amowu / GetStreamingAssetsPath.cs
Created December 25, 2013 08:24
Get Unity StreamingAssets file path with Android and iOS.
// Put your file to "YOUR_UNITY_PROJ/Assets/StreamingAssets"
// example: "YOUR_UNITY_PROJ/Assets/StreamingAssets/db.bytes"
string dbPath = "";
if (Application.platform == RuntimePlatform.Android)
{
// Android
string oriPath = System.IO.Path.Combine(Application.streamingAssetsPath, "db.bytes");
@aras-p
aras-p / Projector Light.shader
Last active September 9, 2024 14:33
Projector shaders without fixed function
Shader "Projector/Light" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" {}
_FalloffTex ("FallOff", 2D) = "" {}
}
Subshader {
Pass {
ZWrite Off
//#define DEBUG_THREADING
using UnityEngine;
using System.Collections;
using System.Threading;
using System.Reflection;
public delegate IEnumerator MonitorCoroutine<T> (CoroutineData<T> data);
@aras-p
aras-p / using_vpos.shader
Last active February 3, 2018 12:39
Using VPOS
// yeah it's not terribly nice
Shader "Foo" {
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
@olegtyshcneko
olegtyshcneko / RichCourutine
Created September 12, 2014 08:57
Unity3d rich courutines
public class RichCourutineManager {
private MonoBehaviour _context;
public RichCourutineManager(MonoBehaviour context) {
_context = context;
}
private RichCourutineManager() {}
public void RunCourutines(params IEnumerator[] courutines) {
@olegtyshcneko
olegtyshcneko / DelayedCourutine
Created September 12, 2014 08:59
Unity3d Delayed Courutine class
public class DelayedCourutine {
public float Seconds { get; set; }
public IEnumerator Courutine { get; set; }
public static DelayedCourutine CreateDelayedCourutine(float seconds, IEnumerator cour) {
return new DelayedCourutine() {
Courutine = cour,
Seconds = seconds
};
}
@aras-p
aras-p / z.shader
Created January 8, 2015 13:31
View space Z shader
Shader "Aaa" {
SubShader {
Cull Off ZTest Always ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
@hymerman
hymerman / RvoGridGraph.cs
Created March 18, 2015 11:30
RVO grid graph for A* Pathfinding Project Pro
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using Pathfinding.RVO;
/** Adds a GridGraph as RVO obstacles.
* Add this to a scene in which has a GridGraph based graph, when scanning (or loading from cache) the graph
* it will be added as RVO obstacles to the RVOSimulator (which must exist in the scene).
*
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude ([email protected])
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@cjddmut
cjddmut / ColorHSV.cs
Last active August 24, 2022 21:02
A HSV Color struct for Unity3D. Allows conversion between UnityEngine.Color and UnityEngine.Color32.
/*
* Created by C.J. Kimberlin (http://cjkimberlin.com)
*
* The MIT License (MIT)
*
* Copyright (c) 2015
*
* 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