浏览代码

Update AssetSourceElement.cs

/generic-asset-sources
Mohsen Kamalzadeh 3 年前
当前提交
fa2d6690
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      com.unity.perception/Editor/Randomization/VisualElements/AssetSource/AssetSourceElement.cs

4
com.unity.perception/Editor/Randomization/VisualElements/AssetSource/AssetSourceElement.cs


}
else
{
m_AssetRoleToolbarMenu.text = GetDisplayName(type);
m_AssetRoleToolbarMenu.text = GetAssetRoleDisplayName(type);
var newAssetRole = (AssetRoleBase)Activator.CreateInstance(type);
m_AssetRoleProperty.managedReferenceValue = newAssetRole;
}

static string GetAssetRoleDisplayName(Type type)
{
return ((AssetRoleBase)Activator.CreateInstance(type)).label;
return $"{((AssetRoleBase)Activator.CreateInstance(type)).label} ({type.Name})";
}
}
}
正在加载...
取消
保存