Reference<Obj> target; //set from mouse cursor click
I want to access data of the obj stored in the reference.
How can I reach a data from the npc class in the image below? (please note it's not always npc, it can be another class like monster, item, harvestable, etc)
Is there a way besides doing a CAST for every possible type?
like if I expand npc class, I see my data there, I just want to know if I can access it without using cast
Thanks
(This post was last modified: 10-18-2011 05:49 AM by alkirah.)
Actually I don't want to get type, I want to get the object pointer so if it's a npc, I want it to return *Npc, a monster would return *Monster and a worlditem would return a *WorldItem, so I could use returnvalue->data
temporarly I added elements to a physx group and when mouse click is on something, I set target=Cur.obj() and targettype=phys_group.targettype (var names here are from memory so might be erroneous) so I know what class to cast.
(This post was last modified: 10-21-2011 07:57 PM by alkirah.)