This file contains hidden or 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
| 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); |
This file contains hidden or 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 hidden or 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
| git config --global http.proxy 'socks5://127.0.0.1:1080' | |
| git config --global https.proxy 'socks5://127.0.0.1:1080' |
This file contains hidden or 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 UnityEditor; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| /// <summary> | |
| /// 可以在编辑器里查看lua脚本 | |
| /// </summary> | |
| [CustomEditor(typeof(DefaultAsset), true)] | |
| public class LuaInspector : Editor |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |