Search the Community
Showing results for tags 'variable'.
-
Hello everyone! I am having difficulties regarding exposing things in the editor. When I make a public variable it is supposed to show up in the editor, but it never does. And it doesn't work no matter the type of variable. Here's the code: using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using Unigine; [Component(PropertyGuid = "9d726b584d9b76d7b9aca64ab1aee121ec3c880c")] public class TowerSpawnUI : Component { public Mesh CubeMesh; private void Init() { Gui GUI = Gui.Get(); WidgetButton Btn = new WidgetButton(GUI, "Click Me!"); Btn.AddCallback(Gui.CALLBACK_INDEX.CLICKED, new Widget.Callback0Delegate(BtnClicked)); GUI.AddChild(Btn); } void BtnClicked() { new Mesh(CubeMesh); } } Here's what shows up in the editor:
-
I am trying use this solution https://developer.un...-as-a-variable/ but got crash. Reproduced on https://developer.un...&attach_id=1200 from https://developer.un...-uniginescript/ topic. Add in C++ mydata testData; testData.name = "Hello from C++"; engine->runWorld("helloStruct", Variable(TypeInfo(TypeID<mydata*>()), &testData)); Add in script void helloStruct(mydata data) { log.message("%s\n", data.getName()); }