Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created January 18, 2018 03:47
Show Gist options
  • Save rdelrosario/376a17191f8a38e451e91137a241d68f to your computer and use it in GitHub Desktop.
Save rdelrosario/376a17191f8a38e451e91137a241d68f to your computer and use it in GitHub Desktop.
PokemonFromFile
SCNNode CreatePokemonNodeFromFile(string filePath,string nodeName,SCNVector3 vector)
{
var pScene = SCNScene.FromFile(filePath);
var pokemon = pScene.RootNode.FindChildNode(nodeName, true);
pokemon.Position = vector;
pokemon.PhysicsBody = SCNPhysicsBody.CreateStaticBody();
pokemon.PhysicsBody.PhysicsShape = SCNPhysicsShape.Create(pokemon);
pokemon.PhysicsBody.ContactTestBitMask = (int)BitMaskCategory.Pokeball;
pokemon.PhysicsBody.CategoryBitMask = (int)BitMaskCategory.Pokemon;
return pokemon;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment