Jump to content

Extend UnigineScript classes support


photo

Recommended Posts

For more convenient using classes in UnigineScript will be good to add:

 

static - to provide access to variables from menu, trigger, etc. callbacks and do global variables.

const - also add some flexibility.

 

In trigger/gui menu callbacks function scope (this) must refer to class - it could be very convenient:

 

class Foo {
   int a;
   PhysicalTrigger trigger;
   Foo() {
      trigger.setEnterCallback("Foo::enter_callback");
   }
   void enter_callback(Body body) {
      a = 2;
   }
};

 

or do some additional instrument for this feature for compatibility with earlier versions.

 

Add ability to inherit from script classes.

Link to comment
×
×
  • Create New...