菜鸟教程小白 发表于 2022-12-13 06:53:39

ios - Sprite 工具包 - 命名重复的对象


                                            <p><p>使用apple spritekit,如果20个节点具有相同的艺术作品并且要随机放置在屏幕上,我如何唯一标识节点?有没有像cocos2d那样更快的方法有一个“标签”功能来识别?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我不是最精通 Sprite ,但这是你要找的东西吗?</p>

<p>保存:</p>

<pre><code>NSArray * nodesArray; // some array of nodes.
for (int x = 0; x &lt; nodesArray.count; x++) {
    SKNode * node = nodesArray;
    node.name = ;
}
</code></pre>

<p>检索:</p>

<pre><code>int nodeToRetrieveTag = 2; // or whatever
SKNode* nodeToRetrieve = ];
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Sprite 工具包 - 命名重复的对象,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/22416084/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/22416084/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Sprite 工具包 - 命名重复的对象