コード例 #1
0
    public void SetUp()
    {
        TestItem       = ScriptableObject.CreateInstance <Item>();
        TestItem.Name  = "Coin";
        TestItem.Id    = "0";
        Database       = ScriptableObject.CreateInstance <ItemDatabase>();
        Database.Items = new Item[] { TestItem };

        InventoryUI = GameObject.Find("InventoryUI").GetComponent <InventoryUI>();
        Inventory inventory = ScriptableObject.CreateInstance <Inventory>();

        inventory.ItemDatabase     = Database;
        GameEventsLogger           = ScriptableObject.CreateInstance <GameEventsLogger>();
        inventory.GameEventsLogger = GameEventsLogger;
        InventoryUI.Inventory      = inventory;
        InventoryUI.Initialize();
    }
コード例 #2
0
    public void SetUp()
    {
        GameEventsLogger = ScriptableObject.CreateInstance <GameEventsLogger>();

        TestItem                    = ScriptableObject.CreateInstance <Item>();
        TestItem.Name               = "Coin";
        TestItem.Id                 = "0";
        Database                    = ScriptableObject.CreateInstance <ItemDatabase>();
        Database.Items              = new Item[] { TestItem };
        InventoryA                  = ScriptableObject.CreateInstance <Inventory>();
        InventoryB                  = ScriptableObject.CreateInstance <Inventory>();
        InventoryA.ItemDatabase     = Database;
        InventoryB.ItemDatabase     = Database;
        InventoryA.GameEventsLogger = GameEventsLogger;
        InventoryB.GameEventsLogger = GameEventsLogger;
        InventoryA.Clear();
        InventoryB.Clear();
    }