src/behavior.c

changeset 265
5c915d01bdc0
parent 197
a1f7c4f858d9
--- a/src/behavior.c	Wed Aug 13 23:55:55 2025 +0200
+++ b/src/behavior.c	Sat Aug 16 22:59:49 2025 +0200
@@ -98,3 +98,19 @@
     assert(behavior != NULL);
     return cx_strcast(behavior->name);
 }
+
+// TODO: add asc_behavior_find() and asc_behavior_find_global()
+
+void asc_behavior_enable_all(AscSceneNode *node) {
+    CxIterator iter = cxListIterator(node->behaviors);
+    cx_foreach(AscBehavior*, behavior, iter) {
+        behavior->enabled = true;
+    }
+}
+
+void asc_behavior_disable_all(AscSceneNode *node) {
+    CxIterator iter = cxListIterator(node->behaviors);
+    cx_foreach(AscBehavior*, behavior, iter) {
+        behavior->enabled = false;
+    }
+}
\ No newline at end of file

mercurial