More work on State System

This commit is contained in:
2023-03-01 08:03:03 -08:00
parent dfcc14f2a7
commit c658fdd08f
6 changed files with 167 additions and 48 deletions

View File

@ -17,8 +17,8 @@ namespace Dawn {
class TicTacToeScene : public Scene {
protected:
Camera *camera;
StateProperty<int32_t> age;
StateEvent<int32_t> ageEvent;
int32_t age = 0;
std::function<void()> evtUnsub;
void stage() override {
camera = Camera::create(this);
@ -43,6 +43,11 @@ namespace Dawn {
tile->ticTacToe->tile = i++;
}
}
evtUnsub = useEventLegacy([&]{
std::cout << "Legacy Event Invoked " << age << std::endl;
evtUnsub();
}, this->eventSceneUpdate);
}
std::vector<Asset*> getRequiredAssets() override {