Search the Community
Showing results for tags 'custom class'.
-
There is example how to create your own Object and add it to world in C++. But is it possible to use custom objects within editor (like in UE4)?
-
I'm making a custom class that extends Unigine's WorldTrigger. I find that two of the constructors below cannot "coexist". These would be the second and third constructors - TriggerObject(vec3 size), TriggerObject(string callback). The interpreter does not throw a correct error in the first place, which took me quite some time to figure out that the class can only work with one constructor but not the other. #ifndef MY_OBJECT_H #define MY_OBJECT_H class TriggerObject : WorldTrigger { public: TriggerObject() : WorldTrigger(vec3_one * 2) { setEnterCallback("OnTriggerEnter", this); setLeaveCallback("OnTriggerExit", this); } TriggerObject (vec3 size) : WorldTrigger(size) { } TriggerObject(string callback) : WorldTrigger(vec3_one * 2) { } ~TriggerObject () { delete extern; } void OnTriggerEnter (Node node, TriggerObject instance) { log.message(node.getName() + " entered.\n"); } void OnTriggerExit (Node node, TriggerObject instance) { log.message(node.getName() + " exited.\n"); } }; #endif Has anybody else experienced this? What is wrong with my code?
- 4 replies
-
- extend Unigine classes
- Node
-
(and 1 more)
Tagged with:
-
Custom classes with automatic update functions
mandee.cabato.ph posted a topic in Feedback for UNIGINE team
I think it would be nice for Unigine to implement its own user extendable class for users who need to create scripts that update automatically. Right now, I achieve this with a custom UpdateObject and a manager that runs from the world script. This feature is equivalent to Unity3d 's Monobehaviour. http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour Thanks! :(