Skip to content

Instantly share code, notes, and snippets.

@sFisherE
sFisherE / DrawBounds.cs
Created January 27, 2024 07:56 — forked from unitycoder/DrawBounds.cs
Draw Bounds with Debug.DrawLine , Draw Box, Draw Runtime Gizmos
void DrawBounds(Bounds b, float delay=0)
{
// bottom
var p1 = new Vector3(b.min.x, b.min.y, b.min.z);
var p2 = new Vector3(b.max.x, b.min.y, b.min.z);
var p3 = new Vector3(b.max.x, b.min.y, b.max.z);
var p4 = new Vector3(b.min.x, b.min.y, b.max.z);
Debug.DrawLine(p1, p2, Color.blue, delay);
Debug.DrawLine(p2, p3, Color.red, delay);
@sFisherE
sFisherE / DrawGrass.cs
Created January 27, 2024 07:55 — forked from Cyanilux/DrawGrass.cs
Experiments with DrawMeshInstanced and DrawMeshInstancedIndirect for drawing grass (over terrain)
// 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 {
@sFisherE
sFisherE / git_proxy_socks5.sh
Created March 7, 2021 01:47 — forked from bluethon/git_proxy_socks5.sh
设置git使用socks5代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
@sFisherE
sFisherE / LuaInspector
Created January 23, 2017 05:33
可以在编辑器里查看lua脚本
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// 可以在编辑器里查看lua脚本
/// </summary>
[CustomEditor(typeof(DefaultAsset), true)]
public class LuaInspector : Editor
@sFisherE
sFisherE / 0_reuse_code.js
Created January 21, 2017 10:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console