// // 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& 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 boolMap = {}, std::map 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& 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 _onNotifyDev = nullptr; }; NS_RU_END #endif /* RUReboltCompt_hpp */