123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- //
- // RUReboltComp.hpp
- // red_utils
- //
- // Created by 徐炼新 on 2024/4/26.
- //
- #ifndef RUReboltCompt_hpp
- #define RUReboltCompt_hpp
- #include "Redream.h"
- #include "RUDefine.h"
- #include "RUReboltLayer.h"
- NS_RU_BEGIN
- ///延时调用,好处,没有key关键字,可以同时加多个.
- void RU_addCallBack(const std::function<void()>& callBack, float dt);
- class ReboltCompt: public cocos2d::Component, public redream::NotifyDevelopmentDelegate
- {
- public:
- virtual ~ReboltCompt();
- CREATE_FUNC(ReboltCompt);
-
- ///其他参数是空.
- static ReboltCompt* LoadReboltComptFile(const string& ccbName, redream::NotifyDevelopmentDelegate *ndDelegate = nullptr);
-
- ///加载Rebolt的redream,没有也能加载.
- ///loaderLib自定义加载ui的class
- ///ndDelegate: NotifyDevelopmentDelegate的实例,如果是空,则返回的 ReboltCompt为代理,此时可以用 ReboltCompt的onNotifyDev函数为回调入口
- ///owner : 通常为nil
- static ReboltCompt* LoadReboltComptFile(const string& ccbName,
- redream::NodeLoaderLibrary* loaderLib,
- redream::NotifyDevelopmentDelegate *ndDelegate,
- Ref* owner);
-
-
- std::string runBehaviacWhitFunName(std::string name, std::map<std::string, bool> boolMap = {}, std::map<std::string, std::string> stringMap = {});
-
- void setCoderDataVar(std::string key, std::string content);
-
- ///延时移除自己的 Node
- void DelayRemoveOwer(float dt=0.017f);
-
- redream::ReboltRedManager* getRRMgr() {return _rs;};
-
- virtual void registerOnNotify(const std::function<void(const ReboltNotifyData&)>& notifyCallback);
-
- protected:
- void onNotifyDevelopment(redream::ReboltRedManager* reboltRedManager,
- redream::NotifyDevelopmentWaiter* waiter,
- std::string notify,
- std::string param,
- bool reboltIsWait,
- Node* outNode) override ;
-
- private:
- redream::ReboltRedManager* _rs = nullptr;
- std::function<void(ReboltNotifyData)> _onNotifyDev = nullptr;
- };
- NS_RU_END
- #endif /* RUReboltCompt_hpp */
|