mirror of
https://github.com/Relintai/props.git
synced 2024-11-12 10:15:25 +01:00
Added ensure_materials_loaded method to PropCache.
This commit is contained in:
parent
cbad187673
commit
9ea2951c66
@ -162,6 +162,12 @@ void PropCache::materials_load() {
|
||||
}
|
||||
}
|
||||
|
||||
void PropCache::ensure_materials_loaded() {
|
||||
if (_materials.size() != _material_paths.size()) {
|
||||
materials_load();
|
||||
}
|
||||
}
|
||||
|
||||
Vector<Variant> PropCache::materials_get() {
|
||||
VARIANT_ARRAY_GET(_materials);
|
||||
}
|
||||
@ -329,6 +335,7 @@ void PropCache::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("material_get_num"), &PropCache::material_get_num);
|
||||
ClassDB::bind_method(D_METHOD("materials_clear"), &PropCache::materials_clear);
|
||||
ClassDB::bind_method(D_METHOD("materials_load"), &PropCache::materials_load);
|
||||
ClassDB::bind_method(D_METHOD("ensure_materials_loaded"), &PropCache::ensure_materials_loaded);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("materials_get"), &PropCache::materials_get);
|
||||
ClassDB::bind_method(D_METHOD("materials_set"), &PropCache::materials_set);
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
int material_get_num() const;
|
||||
void materials_clear();
|
||||
void materials_load();
|
||||
void ensure_materials_loaded();
|
||||
|
||||
Vector<Variant> materials_get();
|
||||
void materials_set(const Vector<Variant> &materials);
|
||||
|
Loading…
Reference in New Issue
Block a user