mirror of
https://github.com/LazyDuchess/OpenTS2.git
synced 2025-01-23 08:41:47 -05:00
Load all UI packages in UILayoutTest
This commit is contained in:
parent
3037c33c7e
commit
bb797ad81c
1 changed files with 15 additions and 7 deletions
|
@ -16,17 +16,25 @@ namespace OpenTS2.Engine.Tests
|
||||||
public class UILayoutTest : MonoBehaviour
|
public class UILayoutTest : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Transform Canvas;
|
public Transform Canvas;
|
||||||
private void Start()
|
void LoadAllUIPackages()
|
||||||
{
|
{
|
||||||
var contentProvider = ContentProvider.Get();
|
var contentProvider = ContentProvider.Get();
|
||||||
var uiPackageLocation = Path.Combine(Filesystem.PathProvider.GetDataPathForProduct(ProductFlags.BaseGame), "Res/UI/ui.package");
|
var relativePackagePath = "Res/UI/ui.package";
|
||||||
contentProvider.AddPackage(uiPackageLocation);
|
var products = EPManager.Get().GetInstalledProducts();
|
||||||
uiPackageLocation = Path.Combine(Filesystem.PathProvider.GetDataPathForProduct(ProductFlags.Mansion), "Res/UI/ui.package");
|
foreach(var product in products)
|
||||||
contentProvider.AddPackage(uiPackageLocation);
|
{
|
||||||
|
var fullPath = Path.Combine(Filesystem.PathProvider.GetDataPathForProduct(product), relativePackagePath);
|
||||||
|
contentProvider.AddPackage(fullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
LoadAllUIPackages();
|
||||||
|
var contentProvider = ContentProvider.Get();
|
||||||
// Main Menu
|
// Main Menu
|
||||||
//var key = new ResourceKey(0x49001017, 0xA99D8A11, TypeIDs.UI);
|
var key = new ResourceKey(0x49001017, 0xA99D8A11, TypeIDs.UI);
|
||||||
// Neighborhood View
|
// Neighborhood View
|
||||||
var key = new ResourceKey(0x49000000, 0xA99D8A11, TypeIDs.UI);
|
//var key = new ResourceKey(0x49000000, 0xA99D8A11, TypeIDs.UI);
|
||||||
//var key = new ResourceKey(0x49001010, 0xA99D8A11, TypeIDs.UI);
|
//var key = new ResourceKey(0x49001010, 0xA99D8A11, TypeIDs.UI);
|
||||||
var mainMenuUILayout = contentProvider.GetAsset<UILayout>(key);
|
var mainMenuUILayout = contentProvider.GetAsset<UILayout>(key);
|
||||||
mainMenuUILayout.Instantiate(Canvas);
|
mainMenuUILayout.Instantiate(Canvas);
|
||||||
|
|
Loading…
Add table
Reference in a new issue