#include #ifdef TOOLS_ENABLED #include #include #endif /* Starting point of animation */ class SmartObject: public Spatial { GDCLASS(SmartObject, Spatial) friend class SmartObjectManager; protected: String anim_state; String anim_finish_state; bool enabled; bool teleport; float distance; SmartObject(); int state; int npc_id; enum {STATE_INIT, STATE_SELECTED, STATE_CLOSE, STATE_ACTIVE, STATE_PROGRESS, STATE_FINISH}; void _notification(int p_what); static void _bind_methods(); #if TOOLS_ENABLED Ref character; void draw_debug(); void clear_debug(); bool run_in_editor; String dump_subnodes(Ref anode) const; template Ref get_anode(Ref r) const { T *p = Object::cast_to(r.ptr()); return Ref(p); } AnimationTree *find_animation_tree(Node *node) const; String get_animation_list() const; #endif public: void _get_property_list(List *p_list) const; bool _get(const StringName &p_name, Variant &r_ret) const; bool _set(const StringName &p_name, const Variant &p_value); bool get_busy() { return state != STATE_INIT; } }; class SmartObjectManager: public Node { GDCLASS(SmartObjectManager, Node) protected: void _notification(int p_what); void update_state(SmartObject *sm); public: static void play_animation(Node *cnode, const String &anim); void arrived(SmartObject *sm, Node *ch); }; /* Manager of group animation */ class SmartObjectGroup: public Spatial { GDCLASS(SmartObjectGroup, Spatial) };