Killer.Penguin Posted February 4, 2014 Share Posted February 4, 2014 To be precise, I'm trying to extend a class from its base class. But I'm not sure how to self construct an extended class in Unigine. Here's an boiled-down example of what I'm trying to do: class ExtendMeshSkinned : ObjectMeshSkinned { private : string nPath; public : ExtendMeshSkinned (string nName, vec3 nPos) { this = ObjectMeshSkinned(nPath + nName); } } Needless to say, it failed miserably. So it gets be wonder if there's such thing as 'this' (c#) in Unigine? If not, how do i make a class call upon its own reference? And how so I construct an extended class using its base class (below the declaration line, not using the ':' inheritence) ? I read your doc: https://developer.unigine.com/en/docs/1.0/scripting/language/oop#inheritance_c. But I'm doing it a bit differently and can't figure out how.. Many thanks in advance, Link to comment
Killer.Penguin Posted February 5, 2014 Author Share Posted February 5, 2014 Hmmm... I'm starting to get this. so Unigine is taking c++ rule in this aspect right? http://www.learncpp.com/cpp-tutorial/114-constructors-and-initialization-of-derived-classes/ Is there anyway to create an extended class from ObjectMeshSkinned() without giving its full path at the beginning? Link to comment
ulf.schroeter Posted February 5, 2014 Share Posted February 5, 2014 https://developer.unigine.com/forum/topic/1625-solved-user-classes-and-casting/?p=8628 Link to comment
ulf.schroeter Posted February 5, 2014 Share Posted February 5, 2014 this + super keyword https://developer.unigine.com/forum/topic/2221-tipstricks/?hl=this+super#entry12186 Link to comment
Killer.Penguin Posted February 5, 2014 Author Share Posted February 5, 2014 Super! Thx. :) Link to comment
Recommended Posts