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
import * as React from 'react' | |
import * as ReactDOM from 'react-dom' | |
type ReactComp<T> = React.StatelessComponent<T> | React.ComponentClass<T> | |
const enum RenderType { Replace, Append } | |
/// Used to automagically inject React component for custom tags in a HTML file | |
// Where P is your component Prop type, C is your react component type | |
export function injectCustomElement<P, C extends ReactComp<P>>(tagName: string, propType: new () => P, comp: C, renderType = RenderType.Replace): React.Component[] | |
{ |
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 EnumFieldAttribute : Attribute | |
{ | |
private object value{get; set;} | |
public EnumFieldAttribute(object val) | |
{ | |
value = val; | |
} | |
public T GetValue<T>() |
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 UnitEngine; | |
public class Example : MonoBehaviour | |
{ | |
//As easy as this ! | |
//You can adjust the slider limits in the inspector as well | |
public Vector3Range v3Range; | |
//... |