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
| public class UnionPolygonController : SerializedMonoBehaviour | |
| { | |
| public static List<List<Vector2>> UnionPolygon(List<List<Vector2>> uvPolygons) | |
| { | |
| List<List<Vector2>> newPolygons = new List<List<Vector2>>(); | |
| #region Fix Winding Order | |
| for (int i = 0; i < uvPolygons.Count; i++) | |
| { | |
| float sum = new float(); |
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 System.Collections.Generic; | |
| using UnityEngine; | |
| public class DistinctRandomColors : MonoBehaviour | |
| { | |
| public Color[] colors; | |
| void RandomColors(int colorCount, out Color[] colors) | |
| { | |
| colors = new Color[colorCount]; |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEditor; | |
| public class AreaOfTrinagle : EditorWindow | |
| { | |
| string objectBaseName = ""; | |
| int objectId = 1; |
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
| $ ruby unique-unordered-pairing-function.rb | |
| Cantor Pairing Function | |
| ----------------------- | |
| <x, y> = (x + y) * (x + y + 1) / 2 + y | |
| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 | |
| + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + ——— + | |
| 0 | 0 | 1 | 3 | 6 | 10 | 15 | 21 | 28 | 36 | 45 | 55 | 66 | 78 | 91 | |