나는 이것을 조사해 보았고 대부분의 정보는 싱글 톤 클래스를 만드는 것에 관한 것이다. 내 menuscreen.m에서 내 helloworldlayer.m에 하나의 가치를 전달하고 싶습니다. 이렇게하는 쉬운 방법은 무엇입니까?하나의 장면에서 다른 장면으로 값 전달
- (void) changeScenePlay
{
CCScene *testscene = [HelloWorldLayer scene];
testscene.number = 1;
[[CCDirector sharedDirector] replaceScene:testscene];
}
내가 시도한 방법 중 하나는 이와 비슷하지만 나에게도 효과가 없습니다.
장면의 변수에 액세스하고 변경하려면 어떻게해야합니까?
testscene.number = 1; 이 라인은 질문 UR –
대답이 답변을 읽고 있습니다 : http://www.koboldtouch.com/display/IDCAR/Strategies+for+Accessing+Other+Nodes – LearnCocos2D