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 | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
//UNFORTUNATELY this doesn't work right now because the inspector doesn't get refreshed properly in debug mode | |
//I'm sure it's fixable but I haven't bothered looking into it yet |
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; | |
#if UNITY_EDITOR | |
using UnityEditor.AssetImporters; | |
using System.IO; | |
[ScriptedImporter(1, "omni")] | |
public class OmniAssetImporter : ScriptedImporter | |
{ | |
public override void OnImportAsset(AssetImportContext ctx) |
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.IO; | |
using System.Text; | |
using System.Collections.Generic; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[CreateAssetMenu(menuName = "AssetLibrary")] | |
public class AssetLibrary : ScriptableObject |
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 | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
public class PrefabClassGenerator |
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
#usage example (when subscribing to an event that returns an agent) | |
ButtonDevice.InteractedWithEvent.SubscribeAgent(OnButtonInteract, "Hello!") | |
OnButtonInteract(Agent : agent, Text : string) : void = | |
Print("Button interacted with {Text}!") | |
#usage example (when subscribing to an event that returns tuple(), aka an empty tuple) | |
CampfireDevice.CampfirePulseEvent.SubscribeEmpty(OnCampfirePulse, 90210) | |
OnCampfirePulse(Number : int) : void = |
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
Begin Object Class=/Script/UnrealEd.MaterialGraphNode_Root Name="MaterialGraphNode_Root_16" | |
Material=/Script/UnrealEd.PreviewMaterial'"/Engine/Transient.PreviewMaterial_2"' | |
NodePosX=144 | |
NodePosY=-80 | |
NodeGuid=DA645A0D405D999F05550EB2B20E74E3 | |
CustomProperties Pin (PinId=94B10B244638D93ADC813DA0DB8A360A,PinName="Base Color",PinType.PinCategory="materialinput",PinType.PinSubCategory="5",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) | |
CustomProperties Pin (PinId=2BA1B6FE4FAF4CE973853CAD1EB7925E,PinName="Metallic",PinType.PinCategory="materialinput",PinType.PinSubCategory="6",PinType.P |
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
global := class<varies><concrete>(): | |
var MaybeMainDevice : ?main_device = false | |
GetMainDevice():main_device = | |
if(MainDevice := Global.MaybeMainDevice?) then MainDevice else main_device{} | |
Global : global = global{} | |
#in the device's OnBegin you call | |
set Global.MaybeMainDevice = option{Self} |
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
<#> Usage | |
MyRoutine := SpawnRoutine(SomeLongRunningTask) | |
MyRoutine.Cancel() | |
SpawnRoutine<public>(Func : type{_()<suspends>:void}):routine = | |
Routine := routine{Func := Func} | |
Routine.Start() | |
return Routine | |
routine<public> := class(): |
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
<#> Usage | |
Routine := SpawnRoutine(SomeLongTask) | |
Routine.Cancel() | |
SpawnRoutine(Func : type{_()<suspends>:void}):routine = | |
Routine := routine{Func := Func} | |
Routine.Start() | |
return Routine | |
routine := class(): |
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
<#> Usage: | |
SortedItems := Sort(Items, true, CompareInt) | |
Sort(Items : []t, IsAscending : logic, Comparer: type{_(:t, :t)<computes> : int} where t : type)<computes> : []t = | |
if (Items.Length > 1, Pivot := Items[Floor(Items.Length/2)]): | |
Left := for(Item : Items, Comparer(Item, Pivot) = -1) do Item | |
Middle := for(Item : Items, Comparer(Item, Pivot) = 0) do Item | |
Right := for(Item : Items, Comparer(Item, Pivot) = 1) do Item |
NewerOlder