Пример #1
0
Resource* MaterialImporter::GetResource(const String& typeName)
{
    if (!typeName.Length())
        return 0;

    ResourceCache* cache = GetSubsystem<ResourceCache>();
    return cache->GetResource(typeName, asset_->GetPath());

}
Resource* ScriptVariant::GetResource() const
{
    if (variant_.GetType() == VAR_RESOURCEREF)
    {
        const ResourceRef& ref = variant_.GetResourceRef();

        if (!ref.name_.Length() || !ref.type_)
            return 0;

        ResourceCache* cache = ScriptSystem::GetContext()->GetSubsystem<ResourceCache>();

        return cache->GetResource(ref.type_, ref.name_);       
    }

    return 0;
}
Пример #3
0
void Zone::SetZoneTextureAttr(const ResourceRef& value)
{
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    zoneTexture_ = static_cast<Texture*>(cache->GetResource(value.type_, value.name_));
}
Пример #4
0
void Light::SetShapeTextureAttr(ResourceRef value)
{
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    shapeTexture_ = static_cast<Texture*>(cache->GetResource(value.type_, value.id_));
}