Ejemplo n.º 1
0
 public void TearDown()
 {
     _inventory  = null;
     _lookup     = null;
     _scriptable = null;
     _reserve    = null;
 }
Ejemplo n.º 2
0
        public void SetUp()
        {
            var go = new GameObject(string.Format("TestObject-{0}", DateTime.Now.Millisecond));

            _inventory = go.AddComponent <Inventory>();
            _lookup    = go.AddComponent <MockProductLookup>();

            _lookup.AddProduct(new Product {
                Category = ProductCategory.Raw, ID = ProductId, Name = ProductName
            });

            _scriptable                  = ScriptableObject.CreateInstance <InventoryScriptable>();
            _scriptable.Products         = new List <ProductEntryInfo>();
            _scriptable.Placeables       = new List <string>();
            _scriptable.ProductMaxAmount = MaxAmount;
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            var go = new GameObject(string.Format("TestObject-{0}", DateTime.Now.Millisecond));

            _inventory = go.AddComponent <Inventory>();
            _lookup    = go.AddComponent <MockProductLookup>();

            _lookup.AddProduct(new Product {
                Category = ProductCategory.Raw, ID = ProductId, Name = ProductName
            });

            _scriptable                  = ScriptableObject.CreateInstance <InventoryScriptable>();
            _scriptable.Products         = new List <ProductEntryInfo>();
            _scriptable.Placeables       = new List <string>();
            _scriptable.ProductMaxAmount = MaxAmount;
            _inventory.BindToScriptable(_scriptable, _lookup);

            _reserve = new InventoryReserve();
            _reserve.Initialize(_inventory);
            _reserve.AddReservation(ProductId, 0, false, false);
        }