Skip to content

Commit 81756eb

Browse files
author
Roberto De Ioris
committed
added actor_destroy() method
1 parent d3f0636 commit 81756eb

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,24 @@ static PyObject *py_ue_actor_components(ue_PyUObject * self, PyObject * args) {
838838
return ret;
839839
}
840840

841+
static PyObject *py_ue_actor_destroy(ue_PyUObject * self, PyObject * args) {
842+
843+
ue_py_check(self);
844+
845+
if (!self->ue_object->IsA<AActor>()) {
846+
return PyErr_Format(PyExc_Exception, "uobject is not an AActor");
847+
}
848+
849+
AActor *actor = (AActor *)self->ue_object;
850+
851+
actor->Destroy();
852+
853+
Py_INCREF(Py_None);
854+
return Py_None;
855+
856+
857+
}
858+
841859

842860

843861
static PyObject *py_ue_is_a(ue_PyUObject *, PyObject *);
@@ -873,6 +891,7 @@ static PyMethodDef ue_PyUObject_methods[] = {
873891
{ "quit_game", (PyCFunction)py_ue_quit_game, METH_VARARGS, "" },
874892
{ "is_input_key_down", (PyCFunction)py_ue_is_input_key_down, METH_VARARGS, "" },
875893
{ "actor_has_component_of_type", (PyCFunction)py_ue_actor_has_component_of_type, METH_VARARGS, "" },
894+
{ "actor_destroy", (PyCFunction)py_ue_actor_destroy, METH_VARARGS, "" },
876895

877896
{ NULL } /* Sentinel */
878897
};

0 commit comments

Comments
 (0)