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
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(Vector3), | |
dynVal => { | |
Table table = dynVal.Table; | |
float x = (float)table.Get("x").CastToNumber(); | |
float y = (float)table.Get("y").CastToNumber(); | |
float z = (float)table.Get("z").CastToNumber(); | |
return new Vector3(x, y, z); | |
} | |
); | |
Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion<Vector3>( |
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
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(Color), | |
dynVal => { | |
Table table = dynVal.Table; | |
float r = (float)table.Get("r").CastToNumber(); | |
float g = (float)table.Get("g").CastToNumber(); | |
float b = (float)table.Get("b").CastToNumber(); | |
float a = (float)table.Get("a").CastToNumber(); | |
return new Color(r, g, b, a); | |
} | |
); |
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
--- A library used for calling and attaching hooks. | |
-- @module Hook | |
Hook = {} | |
local cachedHooks = {} | |
--- Attaches a function to a hook. | |
-- @string hookID The string ID of the hook to be attached to. | |
-- @string uniqueID The unique ID of the function you are attaching to the hook. | |
-- @func func The function to be called when the hook is called. |