hi,
I encountered a problem when I call the Node::GetScene() to get the Scene* value.
The code like following,
void BallMachine::ShootBall()
{
Scene *scene = GetScene();
assert(NULL != scene);
SharedPtr ball(new BaseBall(context_));
scene->AddChild(ball);
ball->Init();
…
}
When the first time I call this function, the function GetScene() can return the right value for Scene*, but when the second time it return a NULL value, anybody encountered this problem?
The BallMachine is a derived class from Node.