mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-20 17:14:44 +01:00
Now both Entity, and WorldSpell inherit from Node, this complicates the setup by a tiny bit (Entity's body property needs to be assigned), but now the module will work in both 2D, and 3D. Also removed the compile time option.
This commit is contained in:
parent
4a166becf4
commit
6aa2df4647
5
SCsub
5
SCsub
@ -2,9 +2,6 @@ import os
|
||||
|
||||
Import('env')
|
||||
|
||||
if ARGUMENTS.get('entities_2d', 'no') == 'yes':
|
||||
env.Append(CPPDEFINES=['ENTITIES_2D'])
|
||||
|
||||
if os.path.isdir('../mesh_data_resource'):
|
||||
env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
|
||||
|
||||
@ -93,7 +90,7 @@ module_env.add_source_files(env.modules_sources,"ui/unit_frame.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"drag_and_drop/es_drag_and_drop.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"skeleton/character_skeleton.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"skeleton/character_skeleton_2d.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"skeleton/character_skeleton_3d.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"skeleton/entity_species_data.cpp")
|
||||
|
@ -11,23 +11,30 @@
|
||||
#include "./data/talent_row_data.h"
|
||||
#include "./skills/entity_skill.h"
|
||||
|
||||
NodePath Entity::get_body_path() {
|
||||
return _body_path;
|
||||
}
|
||||
void Entity::set_body_path(NodePath value) {
|
||||
_body_path = value;
|
||||
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
}
|
||||
Node *Entity::get_body() {
|
||||
return _body;
|
||||
}
|
||||
|
||||
NodePath Entity::get_character_skeleton_path() {
|
||||
return _character_skeleton_path;
|
||||
}
|
||||
|
||||
void Entity::set_character_skeleton_path(NodePath value) {
|
||||
_character_skeleton_path = value;
|
||||
|
||||
Node *node = get_node_or_null(_character_skeleton_path);
|
||||
|
||||
if (node != NULL) {
|
||||
_character_skeleton = Object::cast_to<CharacterSkeleton>(node);
|
||||
} else {
|
||||
_character_skeleton = NULL;
|
||||
}
|
||||
_character_skeleton = get_node_or_null(_character_skeleton_path);
|
||||
}
|
||||
|
||||
CharacterSkeleton *Entity::get_character_skeleton() {
|
||||
Node *Entity::get_character_skeleton() {
|
||||
return _character_skeleton;
|
||||
}
|
||||
|
||||
@ -123,7 +130,8 @@ void Entity::setc_gender(EntityEnums::EntityGender value) {
|
||||
_c_gender = value;
|
||||
|
||||
if (ObjectDB::instance_validate(_character_skeleton)) {
|
||||
_character_skeleton->set_gender(_c_gender);
|
||||
if (_character_skeleton->has_method("set_gender"))
|
||||
_character_skeleton->call("set_gender", _c_gender);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1550,7 +1558,8 @@ void Entity::_capply_item(Ref<ItemInstance> item) {
|
||||
ERR_FAIL_COND(!it.is_valid());
|
||||
|
||||
if (it->get_item_visual().is_valid() && ObjectDB::instance_validate(_character_skeleton)) {
|
||||
_character_skeleton->add_item_visual(it->get_item_visual());
|
||||
if (_character_skeleton->has_method("add_item_visual"))
|
||||
_character_skeleton->call("add_item_visual", it->get_item_visual());
|
||||
}
|
||||
}
|
||||
void Entity::_cdeapply_item(Ref<ItemInstance> item) {
|
||||
@ -1561,7 +1570,8 @@ void Entity::_cdeapply_item(Ref<ItemInstance> item) {
|
||||
ERR_FAIL_COND(!it.is_valid());
|
||||
|
||||
if (it->get_item_visual().is_valid() && ObjectDB::instance_validate(_character_skeleton)) {
|
||||
_character_skeleton->remove_item_visual(it->get_item_visual());
|
||||
if (_character_skeleton->has_method("remove_item_visual"))
|
||||
_character_skeleton->call("remove_item_visual", it->get_item_visual());
|
||||
}
|
||||
}
|
||||
|
||||
@ -5406,18 +5416,37 @@ Entity::~Entity() {
|
||||
|
||||
void Entity::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_INSTANCED: {
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
|
||||
_character_skeleton = get_node_or_null(_character_skeleton_path);
|
||||
|
||||
if (_character_skeleton != NULL) {
|
||||
if (_character_skeleton->has_method("set_gender"))
|
||||
_character_skeleton->call("set_gender", _c_gender);
|
||||
}
|
||||
}
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
if (!Engine::get_singleton()->is_editor_hint())
|
||||
set_process(true);
|
||||
|
||||
Node *node = get_node_or_null(_character_skeleton_path);
|
||||
if (!_body) {
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
if (node != NULL) {
|
||||
_character_skeleton = Object::cast_to<CharacterSkeleton>(node);
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
}
|
||||
|
||||
_character_skeleton->set_gender(_c_gender);
|
||||
} else {
|
||||
_character_skeleton = NULL;
|
||||
if (!_character_skeleton) {
|
||||
_character_skeleton = get_node_or_null(_character_skeleton_path);
|
||||
|
||||
if (_character_skeleton != NULL) {
|
||||
if (_character_skeleton->has_method("set_gender"))
|
||||
_character_skeleton->call("set_gender", _c_gender);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_PROCESS: {
|
||||
@ -5814,6 +5843,10 @@ void Entity::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("onc_untargeted"), &Entity::onc_untargeted);
|
||||
|
||||
//Properties
|
||||
ClassDB::bind_method(D_METHOD("get_body_path"), &Entity::get_body_path);
|
||||
ClassDB::bind_method(D_METHOD("set_body_path", "value"), &Entity::set_body_path);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "body_path"), "set_body_path", "get_body_path");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_character_skeleton_path"), &Entity::get_character_skeleton_path);
|
||||
ClassDB::bind_method(D_METHOD("set_character_skeleton_path", "value"), &Entity::set_character_skeleton_path);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "character_skeleton_path"), "set_character_skeleton_path", "get_character_skeleton_path");
|
||||
@ -6216,6 +6249,7 @@ void Entity::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("changec_skill_max", "skill_id", "value"), &Entity::changec_skill_max);
|
||||
|
||||
//skeleton
|
||||
ClassDB::bind_method(D_METHOD("get_body"), &Entity::get_body);
|
||||
ClassDB::bind_method(D_METHOD("get_character_skeleton"), &Entity::get_character_skeleton);
|
||||
|
||||
//// Targeting System ////
|
||||
|
@ -3,11 +3,7 @@
|
||||
|
||||
#include "core/io/networked_multiplayer_peer.h"
|
||||
|
||||
#ifdef ENTITIES_2D
|
||||
#include "scene/2d/physics_body_2d.h"
|
||||
#else
|
||||
#include "scene/3d/physics_body.h"
|
||||
#endif
|
||||
#include "scene/main/node.h"
|
||||
|
||||
#include "../data/craft_recipe.h"
|
||||
#include "../data/item_instance.h"
|
||||
@ -25,7 +21,6 @@
|
||||
|
||||
#include "../autoloads/entity_data_manager.h"
|
||||
#include "../entity_enums.h"
|
||||
#include "../skeleton/character_skeleton.h"
|
||||
#include "../utility/entity_create_info.h"
|
||||
|
||||
#include "../inventory/bag.h"
|
||||
@ -170,23 +165,21 @@ enum PlayerSendFlags {
|
||||
} \
|
||||
variable = value;
|
||||
|
||||
#ifdef ENTITIES_2D
|
||||
class Entity : public KinematicBody2D {
|
||||
GDCLASS(Entity, KinematicBody2D);
|
||||
#else
|
||||
class Entity : public KinematicBody {
|
||||
GDCLASS(Entity, KinematicBody);
|
||||
#endif
|
||||
class Entity : public Node {
|
||||
GDCLASS(Entity, Node);
|
||||
|
||||
public:
|
||||
void initialize(Ref<EntityCreateInfo> info);
|
||||
|
||||
//// Base ////
|
||||
|
||||
NodePath get_body_path();
|
||||
void set_body_path(NodePath value);
|
||||
Node *get_body();
|
||||
|
||||
NodePath get_character_skeleton_path();
|
||||
void set_character_skeleton_path(NodePath value);
|
||||
|
||||
CharacterSkeleton *get_character_skeleton();
|
||||
Node *get_character_skeleton();
|
||||
|
||||
//EntityType
|
||||
EntityEnums::EntityType gets_entity_type();
|
||||
@ -908,8 +901,11 @@ private:
|
||||
|
||||
//// Paths ////
|
||||
|
||||
NodePath _body_path;
|
||||
Node *_body;
|
||||
|
||||
NodePath _character_skeleton_path;
|
||||
CharacterSkeleton *_character_skeleton;
|
||||
Node *_character_skeleton;
|
||||
|
||||
//// PlayerData ////
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
|
||||
#include "drag_and_drop/es_drag_and_drop.h"
|
||||
|
||||
#include "skeleton/character_skeleton.h"
|
||||
#include "skeleton/character_skeleton_2d.h"
|
||||
#include "skeleton/character_skeleton_3d.h"
|
||||
|
||||
#include "skeleton/species_model_data.h"
|
||||
@ -201,7 +201,7 @@ void register_entity_spell_system_types() {
|
||||
|
||||
ClassDB::register_class<ESDragAndDrop>();
|
||||
|
||||
ClassDB::register_class<CharacterSkeleton>();
|
||||
ClassDB::register_class<CharacterSkeleton2D>();
|
||||
ClassDB::register_class<CharacterSkeleton3D>();
|
||||
|
||||
ClassDB::register_class<EntitySpeciesData>();
|
||||
|
@ -1,43 +0,0 @@
|
||||
#include "character_skeleton.h"
|
||||
|
||||
void CharacterSkeleton::add_item_visual(Ref<ItemVisual> vis) {
|
||||
}
|
||||
void CharacterSkeleton::remove_item_visual(Ref<ItemVisual> vis) {
|
||||
}
|
||||
void CharacterSkeleton::remove_item_visual_index(int index) {
|
||||
}
|
||||
Ref<ItemVisual> CharacterSkeleton::get_item_visual(int index) {
|
||||
return Ref<ItemVisual>();
|
||||
}
|
||||
int CharacterSkeleton::get_item_visual_count() {
|
||||
return 0;
|
||||
}
|
||||
void CharacterSkeleton::clear_item_visuals() {
|
||||
}
|
||||
|
||||
EntityEnums::EntityGender CharacterSkeleton::get_gender() {
|
||||
return _gender;
|
||||
}
|
||||
void CharacterSkeleton::set_gender(EntityEnums::EntityGender value) {
|
||||
_gender = value;
|
||||
}
|
||||
|
||||
CharacterSkeleton::CharacterSkeleton() {
|
||||
_gender = EntityEnums::GENDER_MALE;
|
||||
}
|
||||
|
||||
CharacterSkeleton::~CharacterSkeleton() {
|
||||
}
|
||||
|
||||
void CharacterSkeleton::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_gender"), &CharacterSkeleton::get_gender);
|
||||
ClassDB::bind_method(D_METHOD("set_gender", "value"), &CharacterSkeleton::set_gender);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "gender", PROPERTY_HINT_ENUM, EntityEnums::BINDING_STRING_ENTITY_GENDER), "set_gender", "get_gender");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_item_visual", "vis"), &CharacterSkeleton::add_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("remove_item_visual", "vis"), &CharacterSkeleton::remove_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("remove_item_visual_index", "index"), &CharacterSkeleton::remove_item_visual_index);
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual", "index"), &CharacterSkeleton::get_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual_count"), &CharacterSkeleton::get_item_visual_count);
|
||||
ClassDB::bind_method(D_METHOD("clear_item_visuals"), &CharacterSkeleton::clear_item_visuals);
|
||||
}
|
43
skeleton/character_skeleton_2d.cpp
Normal file
43
skeleton/character_skeleton_2d.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
#include "character_skeleton_2d.h"
|
||||
|
||||
void CharacterSkeleton2D::add_item_visual(Ref<ItemVisual> vis) {
|
||||
}
|
||||
void CharacterSkeleton2D::remove_item_visual(Ref<ItemVisual> vis) {
|
||||
}
|
||||
void CharacterSkeleton2D::remove_item_visual_index(int index) {
|
||||
}
|
||||
Ref<ItemVisual> CharacterSkeleton2D::get_item_visual(int index) {
|
||||
return Ref<ItemVisual>();
|
||||
}
|
||||
int CharacterSkeleton2D::get_item_visual_count() {
|
||||
return 0;
|
||||
}
|
||||
void CharacterSkeleton2D::clear_item_visuals() {
|
||||
}
|
||||
|
||||
EntityEnums::EntityGender CharacterSkeleton2D::get_gender() {
|
||||
return _gender;
|
||||
}
|
||||
void CharacterSkeleton2D::set_gender(EntityEnums::EntityGender value) {
|
||||
_gender = value;
|
||||
}
|
||||
|
||||
CharacterSkeleton2D::CharacterSkeleton2D() {
|
||||
_gender = EntityEnums::GENDER_MALE;
|
||||
}
|
||||
|
||||
CharacterSkeleton2D::~CharacterSkeleton2D() {
|
||||
}
|
||||
|
||||
void CharacterSkeleton2D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_gender"), &CharacterSkeleton2D::get_gender);
|
||||
ClassDB::bind_method(D_METHOD("set_gender", "value"), &CharacterSkeleton2D::set_gender);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "gender", PROPERTY_HINT_ENUM, EntityEnums::BINDING_STRING_ENTITY_GENDER), "set_gender", "get_gender");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_item_visual", "vis"), &CharacterSkeleton2D::add_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("remove_item_visual", "vis"), &CharacterSkeleton2D::remove_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("remove_item_visual_index", "index"), &CharacterSkeleton2D::remove_item_visual_index);
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual", "index"), &CharacterSkeleton2D::get_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual_count"), &CharacterSkeleton2D::get_item_visual_count);
|
||||
ClassDB::bind_method(D_METHOD("clear_item_visuals"), &CharacterSkeleton2D::clear_item_visuals);
|
||||
}
|
@ -1,11 +1,7 @@
|
||||
#ifndef CHARACTER_SKELETON_H
|
||||
#define CHARACTER_SKELETON_H
|
||||
#ifndef CHARACTER_SKELETON_2D_H
|
||||
#define CHARACTER_SKELETON_2D_H
|
||||
|
||||
#ifdef ENTITIES_2D
|
||||
#include "scene/2d/node_2d.h"
|
||||
#else
|
||||
#include "scene/3d/spatial.h"
|
||||
#endif
|
||||
|
||||
#include "core/node_path.h"
|
||||
#include "core/ustring.h"
|
||||
@ -15,13 +11,8 @@
|
||||
|
||||
#include "../data/item_visual.h"
|
||||
|
||||
#ifdef ENTITIES_2D
|
||||
class CharacterSkeleton : public Node2D {
|
||||
GDCLASS(CharacterSkeleton, Node2D);
|
||||
#else
|
||||
class CharacterSkeleton : public Spatial {
|
||||
GDCLASS(CharacterSkeleton, Spatial);
|
||||
#endif
|
||||
class CharacterSkeleton2D : public Node2D {
|
||||
GDCLASS(CharacterSkeleton2D, Node2D);
|
||||
|
||||
public:
|
||||
virtual void add_item_visual(Ref<ItemVisual> vis);
|
||||
@ -34,8 +25,8 @@ public:
|
||||
EntityEnums::EntityGender get_gender();
|
||||
void set_gender(EntityEnums::EntityGender value);
|
||||
|
||||
CharacterSkeleton();
|
||||
~CharacterSkeleton();
|
||||
CharacterSkeleton2D();
|
||||
~CharacterSkeleton2D();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
@ -2,6 +2,13 @@
|
||||
|
||||
#include "../data/item_visual.h"
|
||||
|
||||
EntityEnums::EntityGender CharacterSkeleton3D::get_gender() {
|
||||
return _gender;
|
||||
}
|
||||
void CharacterSkeleton3D::set_gender(EntityEnums::EntityGender value) {
|
||||
_gender = value;
|
||||
}
|
||||
|
||||
bool CharacterSkeleton3D::get_model_dirty() const {
|
||||
return _model_dirty;
|
||||
}
|
||||
@ -224,6 +231,7 @@ void CharacterSkeleton3D::_build_model() {
|
||||
|
||||
CharacterSkeleton3D::CharacterSkeleton3D() {
|
||||
_model_dirty = false;
|
||||
_gender = EntityEnums::GENDER_MALE;
|
||||
|
||||
for (int i = 0; i < EntityEnums::SKELETON_POINTS_MAX; ++i) {
|
||||
_bone_nodes[i] = NULL;
|
||||
@ -256,6 +264,17 @@ void CharacterSkeleton3D::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void CharacterSkeleton3D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_gender"), &CharacterSkeleton3D::get_gender);
|
||||
ClassDB::bind_method(D_METHOD("set_gender", "value"), &CharacterSkeleton3D::set_gender);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "gender", PROPERTY_HINT_ENUM, EntityEnums::BINDING_STRING_ENTITY_GENDER), "set_gender", "get_gender");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_item_visual", "vis"), &CharacterSkeleton3D::add_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("remove_item_visual", "vis"), &CharacterSkeleton3D::remove_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("remove_item_visual_index", "index"), &CharacterSkeleton3D::remove_item_visual_index);
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual", "index"), &CharacterSkeleton3D::get_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual_count"), &CharacterSkeleton3D::get_item_visual_count);
|
||||
ClassDB::bind_method(D_METHOD("clear_item_visuals"), &CharacterSkeleton3D::clear_item_visuals);
|
||||
|
||||
BIND_VMETHOD(MethodInfo("_build_model"));
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_model_dirty"), &CharacterSkeleton3D::get_model_dirty);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef CHARACTER_SKELETON_3D_H
|
||||
#define CHARACTER_SKELETON_3D_H
|
||||
|
||||
#include "character_skeleton.h"
|
||||
#include "scene/main/node.h"
|
||||
|
||||
#include "core/vector.h"
|
||||
|
||||
@ -17,11 +17,14 @@
|
||||
|
||||
class ItemVisual;
|
||||
|
||||
//Rename to HumanoidCharSkeleton
|
||||
class CharacterSkeleton3D : public CharacterSkeleton {
|
||||
GDCLASS(CharacterSkeleton3D, CharacterSkeleton);
|
||||
//Rename to HumanoidCharSkeleton -> maybe make that a subclass?
|
||||
class CharacterSkeleton3D : public Spatial {
|
||||
GDCLASS(CharacterSkeleton3D, Spatial);
|
||||
|
||||
public:
|
||||
EntityEnums::EntityGender get_gender();
|
||||
void set_gender(EntityEnums::EntityGender value);
|
||||
|
||||
bool get_model_dirty() const;
|
||||
void set_model_dirty(bool value);
|
||||
|
||||
@ -79,6 +82,7 @@ protected:
|
||||
};
|
||||
|
||||
private:
|
||||
EntityEnums::EntityGender _gender;
|
||||
NodePath _animation_player_path;
|
||||
NodePath _animation_tree_path;
|
||||
|
||||
|
@ -1,5 +1,19 @@
|
||||
#include "world_spell.h"
|
||||
|
||||
NodePath WorldSpell::get_body_path() {
|
||||
return _body_path;
|
||||
}
|
||||
void WorldSpell::set_body_path(NodePath value) {
|
||||
_body_path = value;
|
||||
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
}
|
||||
Node *WorldSpell::get_body() {
|
||||
return _body;
|
||||
}
|
||||
|
||||
int WorldSpell::get_data_id() {
|
||||
return _data_id;
|
||||
@ -114,6 +128,12 @@ WorldSpell::~WorldSpell() {
|
||||
}
|
||||
|
||||
void WorldSpell::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_body_path"), &WorldSpell::get_body_path);
|
||||
ClassDB::bind_method(D_METHOD("set_body_path", "value"), &WorldSpell::set_body_path);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "body_path"), "set_body_path", "get_body_path");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_body"), &WorldSpell::get_body);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_data_id"), &WorldSpell::get_data_id);
|
||||
ClassDB::bind_method(D_METHOD("set_data_id", "value"), &WorldSpell::set_data_id);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_id"), "set_data_id", "get_data_id");
|
||||
|
@ -1,11 +1,7 @@
|
||||
#ifndef WORLD_SPELL_H
|
||||
#define WORLD_SPELL_H
|
||||
|
||||
#ifdef ENTITIES_2D
|
||||
#include "scene/2d/node_2d.h"
|
||||
#else
|
||||
#include "scene/3d/spatial.h"
|
||||
#endif
|
||||
#include "scene/main/node.h"
|
||||
|
||||
#include "core/vector.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
@ -15,15 +11,14 @@
|
||||
#include "world_spell_data.h"
|
||||
|
||||
|
||||
#ifdef ENTITIES_2D
|
||||
class WorldSpell : public Node2D {
|
||||
GDCLASS(WorldSpell, Node2D);
|
||||
#else
|
||||
class WorldSpell : public Spatial {
|
||||
GDCLASS(WorldSpell, Spatial);
|
||||
#endif
|
||||
class WorldSpell : public Node {
|
||||
GDCLASS(WorldSpell, Node);
|
||||
|
||||
public:
|
||||
NodePath get_body_path();
|
||||
void set_body_path(NodePath value);
|
||||
Node *get_body();
|
||||
|
||||
int get_data_id();
|
||||
void set_data_id(int value);
|
||||
|
||||
@ -70,6 +65,9 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
NodePath _body_path;
|
||||
Node *_body;
|
||||
|
||||
int _data_id;
|
||||
Ref<WorldSpellData> _data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user