Created by CauĂȘ Waneck / @cwaneck
import cs.NativeArray;
import unityengine.*;
@:nativeGen class ExampleScript extends unityengine.MonoBehaviour
{
public var stringProp:String;
public var arrayProp:NativeArray<Int>;
public var vectorProp:Vector3;
@:protected var protectedVar:Int;
function Update()
{
Debug.Log("It's working!");
}
}
#pragma warning disable 109, 114, 219, 429, 168, 162
public class ExampleScript : global::UnityEngine.MonoBehaviour {
public ExampleScript() : base() {
}
public string stringProp;
public int[] arrayProp;
public global::UnityEngine.Vector3 vectorProp;
protected int protectedVar;
public virtual void Update() {
global::UnityEngine.Debug.Log(((object) ("It\'s working!") ));
}
}
//C#
EditorApplication.update += delegate() { Debug.Log("update"); };
void Update() {}
SomeComponent comp = GetComponent<SomeComponent>();
[UnityEngine.InitializeOnLoad] public class Something ...
//Haxe
EditorApplication.update += function() Debug.Log('update');
function Update() {}
var comp:SomeComponent = GetComponent(); //or var comp = (GetComponent() : SomeComponent)
@:meta(UnityEngine.InitializeOnLoad) class Something ...
$ haxelib run unihx init path/to/dir
1. Comments show up in inspector
2. Extra properties through comment tags
3. Custom controls
4. Editor-time control events
5. Haxe types support