Pastaspace Posted March 21, 2014 Share Posted March 21, 2014 Couldn't find a good topic on this, so I'm gonna ask myself. Say I have a scene that I've loaded, and inside the scene I want to retrieve all of the entities of a specific type (like say, I want to get all the oil barrels for my barrel-romance simulator). The problem is, I can't find a place to start. How would I implement a function where I could parse a scene for all of a type of entity? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 21, 2014 Share Posted March 21, 2014 Doesn't 2.5 return a root entity the entire scene is parented to? So you would just iterate through the children. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Pastaspace Posted March 21, 2014 Author Share Posted March 21, 2014 That would be the entity returned by LoadScene() correct? Quote Link to comment Share on other sites More sharing options...
Flexman Posted March 21, 2014 Share Posted March 21, 2014 You can use that. This is an example. e is of type TEntity en is a string scene = LoadScene("abstract::myscene.sbx"); childCount = CountChildren(scene); for(i=1;i<=childCount;i++) { e=GetChild(scene,i); en=GetEntityKey(e,"name"); ... ... 1 Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.