当前位置: 首页>>代码示例>>C++>>正文


C++ StringName函数代码示例

本文整理汇总了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();
}
开发者ID:GalanCM,项目名称:godot,代码行数:7,代码来源:texture_region_editor_plugin.cpp

示例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;

}
开发者ID:RYG81,项目名称:godot,代码行数:7,代码来源:animation_tree_player.cpp

示例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
}
开发者ID:Ranakhamis,项目名称:godot,代码行数:28,代码来源:string_db.cpp

示例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;
    }
}
开发者ID:dbsGen,项目名称:my_godot_modules,代码行数:26,代码来源:statusbnode.cpp

示例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;
}
开发者ID:dbsGen,项目名称:my_godot_modules,代码行数:25,代码来源:new_timer.cpp

示例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];
}
开发者ID:zuloloxi,项目名称:godot,代码行数:7,代码来源:packed_scene.cpp

示例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);
    }
}
开发者ID:dbsGen,项目名称:my_godot_modules,代码行数:8,代码来源:anim_controller.cpp

示例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;

}
开发者ID:gau-veldt,项目名称:godot,代码行数:8,代码来源:networked_multiplayer_enet.cpp

示例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
}
开发者ID:KellyThomas,项目名称:godot,代码行数:9,代码来源:class_db.cpp

示例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;
}
开发者ID:allkhor,项目名称:godot,代码行数:9,代码来源:gd_tokenizer.cpp

示例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
}
开发者ID:261117370,项目名称:godot,代码行数:9,代码来源:object_type_db.cpp

示例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];
}
开发者ID:Martho42,项目名称:godot,代码行数:10,代码来源:gd_tokenizer.cpp

示例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();
	}
}
开发者ID:RandomShaper,项目名称:godot,代码行数:11,代码来源:animation_state_machine_editor.cpp

示例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;

}
开发者ID:AwsomeGameEngine,项目名称:godot,代码行数:7,代码来源:animation_player.cpp

示例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();
}
开发者ID:KellyThomas,项目名称:godot,代码行数:25,代码来源:class_db.cpp


注:本文中的StringName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。