mirror of
https://github.com/LazyDuchess/OpenTS2.git
synced 2025-01-23 00:31: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 Transform Canvas;
|
||||
private void Start()
|
||||
void LoadAllUIPackages()
|
||||
{
|
||||
var contentProvider = ContentProvider.Get();
|
||||
var uiPackageLocation = Path.Combine(Filesystem.PathProvider.GetDataPathForProduct(ProductFlags.BaseGame), "Res/UI/ui.package");
|
||||
contentProvider.AddPackage(uiPackageLocation);
|
||||
uiPackageLocation = Path.Combine(Filesystem.PathProvider.GetDataPathForProduct(ProductFlags.Mansion), "Res/UI/ui.package");
|
||||
contentProvider.AddPackage(uiPackageLocation);
|
||||
var relativePackagePath = "Res/UI/ui.package";
|
||||
var products = EPManager.Get().GetInstalledProducts();
|
||||
foreach(var product in products)
|
||||
{
|
||||
var fullPath = Path.Combine(Filesystem.PathProvider.GetDataPathForProduct(product), relativePackagePath);
|
||||
contentProvider.AddPackage(fullPath);
|
||||
}
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
LoadAllUIPackages();
|
||||
var contentProvider = ContentProvider.Get();
|
||||
// Main Menu
|
||||
//var key = new ResourceKey(0x49001017, 0xA99D8A11, TypeIDs.UI);
|
||||
var key = new ResourceKey(0x49001017, 0xA99D8A11, TypeIDs.UI);
|
||||
// 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 mainMenuUILayout = contentProvider.GetAsset<UILayout>(key);
|
||||
mainMenuUILayout.Instantiate(Canvas);
|
||||
|
|
Loading…
Reference in a new issue