Ejemplo n.º 1
0
Resource* MaterialImporter::GetResource(const String& typeName)
{
    if (!typeName.Length())
        return 0;

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

}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
void Zone::SetZoneTextureAttr(const ResourceRef& value)
{
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    zoneTexture_ = static_cast<Texture*>(cache->GetResource(value.type_, value.name_));
}
Ejemplo n.º 4
0
void Light::SetShapeTextureAttr(ResourceRef value)
{
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    shapeTexture_ = static_cast<Texture*>(cache->GetResource(value.type_, value.id_));
}