Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- EcsSetup
- EcsPlaying
- EcsEditing
- EcsPlayable
- EcsEditable
- */
- void setup(world)
- {
- ECS_SYSTEM(world, gameplay_setup, EcsOnLoad,
- " EcsSetup\
- , EcsPlayable
- ,.setup_playable"
- );
- ECS_SYSTEM(world, gameplay_begin, EcsOnLoad,
- " EcsSetup\
- , EcsPlaying
- ,.backup_playable"
- );
- ECS_SYSTEM(world, gameplay_end, EcsOnLoad,
- " EcsSetup\
- ,!EcsPlaying
- ,.restore_playable"
- );
- ECS_SYSTEM(world, editing_begin, EcsOnLoad,
- " EcsSetup\
- , EcsEditing
- ,.enable_editable"
- );
- ECS_SYSTEM(world, editing_end, EcsOnLoad,
- " EcsSetup\
- ,!EcsEditing
- ,.disable_editable"
- );
- }
- void tick(world, editing)
- {
- if (editing)
- {
- ecs_remove(world, ECS_SINGLETON, EcsPlaying);
- if (ecs_add(world, ECS_SINGLETON, EcsEditing))
- {
- ecs_add(world, ECS_SINGLETON, EcsSetup);
- }
- }
- else
- {
- ecs_remove(world, ECS_SINGLETON, EcsEditing);
- if (ecs_add(world, ECS_SINGLETON, EcsPlaying))
- {
- ecs_add(world, ECS_SINGLETON, EcsSetup);
- }
- }
- ecs_progress(world, 0);
- ecs_remove(world, ECS_SINGLETON, EcsSetup);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement