This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Threading.Tasks; | |
public class AsyncHttpWebRequest | |
{ | |
private HttpWebRequest webRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class RaycastOBB : MonoBehaviour { | |
public Vector3 rayOrigin = new Vector3(5.0f, 10.0f, 7.0f); | |
public Vector3 rayDirection = new Vector3(-15.0f, 33.0f, 10.0f); | |
public Vector3 obbRotation = new Vector3(10.0f, 260.0f, 170.0f); | |
public Vector3 obbPosition = new Vector3(0.0f, 20.0f, 10.0f); | |
public Vector3 obbHalfSize = new Vector3(1.0f, 1.0f, 1.0f); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://twitter.com/Cyanilux/status/1396848736022802435?s=20 | |
#ifndef GRASS_INSTANCED_INCLUDED | |
#define GRASS_INSTANCED_INCLUDED | |
// ---------------------------------------------------------------------------------- | |
// Graph should contain Boolean Keyword, "PROCEDURAL_INSTANCING_ON", Global, Multi-Compile. | |
// Must have two Custom Functions in vertex stage. One is used to attach this file (see Instancing_float below), | |
// and another to set #pragma instancing_options : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://twitter.com/Cyanilux/status/1396848736022802435 | |
// Requires a specific shader to read the _PerInstanceData buffer at SV_InstanceID | |
// I use a shader made in Shader Graph, See : https://gist.github.com/Cyanilux/4046e7bf3725b8f64761bf6cf54a16eb | |
// Also note, there's no frustum culling involved in this example. Typically a compute shader is used for this. | |
using UnityEngine; | |
public class DrawGrass : MonoBehaviour { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEditor; | |
// Replaces Unity terrain trees with prefab GameObject. | |
// http://answers.unity3d.com/questions/723266/converting-all-terrain-trees-to-gameobjects.html | |
[ExecuteInEditMode] | |
public class TreeReplacerS : EditorWindow { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nape.util.BitmapDebug; | |
import nape.geom.Vec2; | |
class Perlin3D { | |
public static inline function noise(x:Float, y:Float = 0.0, z:Float = 0.0) { | |
var X:Int = untyped __int__(x); x -= X; X &= 0xff; | |
var Y:Int = untyped __int__(y); y -= Y; Y &= 0xff; | |
var Z:Int = untyped __int__(z); z -= Z; Z &= 0xff; | |
var u = fade(x); var v = fade(y); var w = fade(z); | |
var A = p(X) +Y; var AA = p(A)+Z; var AB = p(A+1)+Z; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
namespace MyBox | |
{ | |
public class ColliderGizmo : MonoBehaviour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Generates a trail that is always facing upwards using the scriptable mesh interface. | |
vertex colors and uv's are generated similar to the builtin Trail Renderer. | |
To use it | |
1. create an empty game object | |
2. attach this script and a MeshRenderer | |
3. Then assign a particle material to the mesh renderer | |
*/ | |
var height = 2.0; | |
var time = 2.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Hidden/EdgeDetect" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "" {} | |
} | |
CGINCLUDE | |
#include "UnityCG.cginc" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class QualityManager : Singleton<QualityManager> { | |
private int QUALITY_INDEX = 0; | |
public int MIN_FPS = 28; | |
public Text qualityUIText; |
NewerOlder