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 System; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
public class SpriteShapeUtils | |
{ |
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
var input = File.ReadAllText(Path.GetDirectoryName(Util.CurrentQueryPath) + @"\..\Inputs\aoc_day12.txt"); | |
var lines = input.Split('\n').Select(line=>line.Trim()).ToArray(); | |
var connections = new Dictionary<int,List<int>>(); | |
var nodes = new List<string>(); | |
foreach(var line in lines) | |
{ | |
var nodeA = line.Split('-')[0]; | |
var nodeB = line.Split('-')[1]; | |
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
var input = File.ReadAllText(Path.GetDirectoryName(Util.CurrentQueryPath) + @"\..\Inputs\aoc_day12.txt"); | |
var lines = input.Split('\n').Select(line=>line.Trim()).ToArray(); | |
var connections = new Dictionary<string,List<string>>(); | |
foreach(var line in lines) | |
{ | |
var nodeA = line.Split('-')[0]; | |
var nodeB = line.Split('-')[1]; | |
if(!connections.TryGetValue(nodeA, out var listA)) connections[nodeA] = listA = new List<string>(); | |
if(!connections.TryGetValue(nodeB, out var listB)) connections[nodeB] = listB = new List<string>(); |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
#if UNITY_EDITOR //this allows the user to put it in a non-editor folder if they want, since it's not accessing anything else | |
using UnityEditor; | |
using UnityEngine; | |
[CustomEditor(typeof(DefaultAsset))] | |
public class FolderNoteEditor : Editor | |
{ | |
bool isFolder; | |
string path; | |
AssetImporter importer; |
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 "Futile/FancyColorSwap" | |
{ | |
Properties | |
{ | |
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
_ColorR ("Red Replacement Color", Color) = (1,0,0,1) | |
_ColorG ("Green Replacement Color", Color) = (0,1,0,1) | |
_ColorB ("Blue Replacement Color", Color) = (0,0,1,1) | |
} | |
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 "Futile/ColorSwap" | |
{ | |
Properties | |
{ | |
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
_ColorR ("Red Replacement Color", Color) = (1,0,0,1) | |
_ColorG ("Green Replacement Color", Color) = (0,1,0,1) | |
_ColorB ("Blue Replacement Color", Color) = (0,0,1,1) | |
} | |
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 UnityEditor.AssetImporters; | |
using System; | |
using System.IO; | |
//ScriptedImporter docs: https://docs.unity3d.com/Manual/ScriptedImporters.html | |
[ScriptedImporter(1, "pix")] |
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 UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
//parts of this were inspired by https://github.com/prime31/UIToolkit/blob/master/Assets/Plugins/UIToolkit/UIElements/UIText.cs | |
public class FLabel : FFacetElementNode | |
{ | |
public Action SignalTextChange; |
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 InstancedExample : MonoBehaviour | |
{ | |
public int instanceCount = 1000; | |
public Mesh instanceMesh; | |
public Material instanceMaterial; | |
public int subMeshIndex = 0; |