本文整理汇总了C++中StringName函数的典型用法代码示例。如果您正苦于以下问题:C++ StringName函数的具体用法?C++ StringName怎么用?C++ StringName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了StringName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _changed_callback
void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_prop) {
if (!is_visible())
return;
if (p_prop == StringName("atlas") || p_prop == StringName("texture"))
_edit_region();
}
示例2: ERR_FAIL_COND_V
StringName AnimationTreePlayer::node_get_input_source(const StringName& p_node,int p_input) const {
ERR_FAIL_COND_V(!node_map.has(p_node),StringName());
ERR_FAIL_INDEX_V( p_input,node_map[p_node]->inputs.size(),StringName() );
return node_map[p_node]->inputs[p_input].node;
}
示例3: ERR_FAIL_COND_V
StringName StringName::search(const String &p_name) {
ERR_FAIL_COND_V(p_name == "", StringName());
lock->lock();
uint32_t hash = p_name.hash();
uint32_t idx = hash & STRING_TABLE_MASK;
_Data *_data = _table[idx];
while (_data) {
// compare hash first
if (_data->hash == hash && p_name == _data->get_name())
break;
_data = _data->next;
}
if (_data && _data->refcount.ref()) {
lock->unlock();
return StringName(_data);
}
lock->unlock();
return StringName(); //does not exist
}
示例4: if
BehaviorNode::Status StatusBNode::_step(const Variant &target, Dictionary &env) {
if (!get_behavior_enable() || get_child_count() == 0)
return STATUS_FAILURE;
if ((bool)call(StringName("pre_behavior"),target, Variant(env)) && get_child_count() > 0) {
if (_selected < 0) {
_selected = 0;
}else if (_selected >= get_child_count()) {
_selected = get_child_count() - 1;
}
BehaviorNode *b_node = get_child(_selected)->cast_to<BehaviorNode>();
Status childrenStatus = STATUS_FAILURE;
if (b_node) {
if (_selected != _old_selected)
b_node->reset(target);
childrenStatus = b_node->step(target, env);
}
_old_selected = _selected;
Status status = (Status)((int)call(StringName("behavior"),target, Variant(env)));
if (status == STATUS_DEPEND_ON_CHILDREN)
return childrenStatus;
else
return status;
}else {
return STATUS_FAILURE;
}
}
示例5: ERR_FAIL_COND_V
Ref<TimerObject> NewTimer::wait(float p_time) {
const String timer_key = "new_timer";
MainLoop *main_loop = OS::get_singleton()->get_main_loop();
SceneTree *tree = main_loop->cast_to<SceneTree>();
ERR_FAIL_COND_V(tree == NULL, NULL);
Viewport *viewport = tree->get_root();
ERR_FAIL_COND_V(viewport == NULL, NULL);
if (timerNode==NULL) {
timerNode = memnew(TimerNode);
timerNode->set_name(timer_key);
Vector<Variant> vector;
vector.push_back(Variant(timerNode));
tree->connect(StringName("idle_frame"), this, StringName("_add_node"), vector, 0);
}
Ref<TimerObject> obj = memnew(TimerObject);
obj->time = p_time;
timerNode->timer_objs.push_back(obj);
timerNode->check_queue();
return obj;
}
示例6: ERR_FAIL_INDEX_V
StringName SceneState::get_node_type(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,nodes.size(),StringName());
if (nodes[p_idx].type==TYPE_INSTANCED)
return StringName();
return names[nodes[p_idx].type];
}
示例7: StringName
void AnimController::add_child_notify(Node *p_child) {
if (p_child->is_type("AnimationPlayer")) {
anim_nodes[p_child->get_name()] = p_child;
Vector<Variant> binds;
binds.push_back(p_child);
p_child->connect(StringName("finished"), this, StringName("_animation_finished"), binds);
}
}
示例8: ERR_FAIL_COND_V
StringName NetworkedMultiplayerENet::get_packet_peer() const{
ERR_FAIL_COND_V(!active,StringName());
ERR_FAIL_COND_V(incoming_packets.size()==0,StringName());
return incoming_packets.front()->get().from;
}
示例9: ERR_FAIL_COND_V
StringName ClassDB::get_category(const StringName &p_node) {
ERR_FAIL_COND_V(!classes.has(p_node), StringName());
#ifdef DEBUG_ENABLED
return classes[p_node].category;
#else
return StringName();
#endif
}
示例10: ERR_FAIL_COND_V
StringName GDTokenizerText::get_token_identifier(int p_offset) const {
ERR_FAIL_COND_V(p_offset <= -MAX_LOOKAHEAD, StringName());
ERR_FAIL_COND_V(p_offset >= MAX_LOOKAHEAD, StringName());
int ofs = (TK_RB_SIZE + tk_rb_pos + p_offset - MAX_LOOKAHEAD - 1) % TK_RB_SIZE;
ERR_FAIL_COND_V(tk_rb[ofs].type != TK_IDENTIFIER, StringName());
return tk_rb[ofs].identifier;
}
示例11: ERR_FAIL_COND_V
StringName ObjectTypeDB::get_category(const StringName& p_node) {
ERR_FAIL_COND_V(!types.has(p_node),StringName());
#ifdef DEBUG_ENABLED
return types[p_node].category;
#else
return StringName();
#endif
}
示例12: ERR_FAIL_INDEX_V
StringName GDTokenizerBuffer::get_token_identifier(int p_offset) const{
int offset = token+p_offset;
ERR_FAIL_INDEX_V(offset,tokens.size(),StringName());
uint32_t identifier = tokens[offset]>>TOKEN_BITS;
ERR_FAIL_INDEX_V(identifier,identifiers.size(),StringName());
return identifiers[identifier];
}
示例13: StringName
void AnimationNodeStateMachineEditor::_update_mode() {
if (tool_select->is_pressed()) {
tool_erase_hb->show();
tool_erase->set_disabled(selected_node == StringName() && selected_transition_from == StringName() && selected_transition_to == StringName());
tool_autoplay->set_disabled(selected_node == StringName());
tool_end->set_disabled(selected_node == StringName());
} else {
tool_erase_hb->hide();
}
}
示例14: StringName
StringName AnimationPlayer::animation_get_next(const StringName& p_animation) const{
if (!animation_set.has(p_animation))
return StringName();
return animation_set[p_animation].next;
}
示例15: while
StringName ClassDB::get_integer_constant_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) {
OBJTYPE_RLOCK;
ClassInfo *type = classes.getptr(p_class);
while (type) {
const StringName *k = NULL;
while ((k = type->enum_map.next(k))) {
List<StringName> &constants_list = type->enum_map.get(*k);
const List<StringName>::Element *found = constants_list.find(p_name);
if (found)
return *k;
}
if (p_no_inheritance)
break;
type = type->inherits_ptr;
}
return StringName();
}