Skip to content

Commit d60af4e

Browse files
committed
Update Utils.h
1 parent 7586dd9 commit d60af4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/Utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ namespace AlphaUtils {
101101
}
102102

103103
template <typename Layer>
104-
static inline std::optional<cocos2d::CCNode*> getLayer() {
104+
static inline std::optional<Layer> getLayer() {
105105

106106
auto scene = cocos2d::CCDirector::sharedDirector()->getRunningScene();
107107
if (cocos2d::CCTransitionScene* trans = geode::cast::typeinfo_cast<cocos2d::CCTransitionScene*>(scene)) {
108108
scene = public_cast(trans, m_pInScene);
109109
}
110110
if (scene) {
111-
if (cocos2d::CCNode* node = scene->getChildByType<Layer>(0)) {
111+
if (Layer node = scene->getChildByType<Layer>(0)) {
112112
return node;
113113
}
114114
}

0 commit comments

Comments
 (0)