本文整理汇总了C#中InventoryItem类的典型用法代码示例。如果您正苦于以下问题:C# InventoryItem类的具体用法?C# InventoryItem怎么用?C# InventoryItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InventoryItem类属于命名空间,在下文中一共展示了InventoryItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
public void Show(InventoryItem it,InventoryItemUI itUI,bool isleft=true)
{
this.it = it;
this.itUI = itUI;
gameObject.SetActive(true);
Vector3 pos = transform.localPosition;
this.isLeft = isleft;
if(isleft)
{
transform.localPosition = new Vector3(-Mathf.Abs(pos.x),pos.y,pos.z);
buttonnameLbel.text = "装备";
upgradeBtn.isEnabled = false;
}
else
{
transform.localPosition = new Vector3(Mathf.Abs(pos.x), pos.y, pos.z);
buttonnameLbel.text = "卸下";
upgradeBtn.isEnabled = true;
}
icon.spriteName = it.Inventory.Icon;
nameLabel.text = it.Inventory.Name;
qualityLabel.text = it.Inventory.Quality.ToString();
lifeLabel.text = it.Inventory.HP.ToString();
damageLabel.text = it.Inventory.Damage.ToString();
powerLabel.text = it.Inventory.Power.ToString();
desLabel.text = it.Inventory.Des.ToString();
levelLabel.text = it.Level.ToString();
}
示例2: addItemRecord
public void addItemRecord()
{
NetSuiteService service = new NetSuiteService();
service.CookieContainer = new CookieContainer();
NetsuiteUser user = new NetsuiteUser("3451682", "[email protected]e.com", "1026", "tridenT168");
Passport passport = user.prepare(user);
Status status = service.login(passport).status;
string itemName = this.ItemName;
SearchStringField objItemName = new SearchStringField();
objItemName.searchValue = itemName;
[email protected] = [email protected];
objItemName.operatorSpecified = true;
ItemSearch objItemSearch = new ItemSearch();
objItemSearch.basic = new ItemSearchBasic();
objItemSearch.basic.itemId = objItemName;
SearchPreferences searchPreferences = new SearchPreferences();
searchPreferences.bodyFieldsOnly = false;
service.searchPreferences = searchPreferences;
SearchResult objItemResult = service.search(objItemSearch);
if (objItemResult.status.isSuccess != true) throw new Exception("Cannot find Item " + itemName + " " + objItemResult.status.statusDetail[0].message);
if (objItemResult.recordList.Count() != 1) throw new Exception("More than one item found for item " + itemName);
InventoryItem iRecord = new InventoryItem();
iRecord = ((InventoryItem)objItemResult.recordList[0]);
this.itemRecord = new InventoryItem();
this.itemRecord=iRecord;
}
示例3: InventoryImage
internal InventoryImage( InventoryManager manager, InventoryItem ii )
: base(manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
{
if( (ii.InvType != 0) || (ii.Type != Asset.ASSET_TYPE_IMAGE) )
{
throw new Exception("The InventoryItem cannot be converted to a Image/Texture, wrong InvType/Type.");
}
this.iManager = manager;
this._Asset = ii._Asset;
this._AssetID = ii._AssetID;
this._BaseMask = ii._BaseMask;
this._CRC = ii._CRC;
this._CreationDate = ii._CreationDate;
this._EveryoneMask = ii._EveryoneMask;
this._Flags = ii._Flags;
this._GroupID = ii._GroupID;
this._GroupMask = ii._GroupMask;
this._GroupOwned = ii._GroupOwned;
this._InvType = ii._InvType;
this._NextOwnerMask = ii._NextOwnerMask;
this._OwnerID = ii._OwnerID;
this._OwnerMask = ii._OwnerMask;
this._SalePrice = ii._SalePrice;
this._SaleType = ii._SaleType;
this._Type = ii._Type;
}
示例4: DrawMe
public override void DrawMe()
{
InventoryBox.DrawMe();
if(ItemGrid.IsClicked())
{
_maestro.PlayOneShot(ButtonSound);
_currentItem = (InventoryItem) ItemGrid.SelectedObject;
LoadItemInCommandBar(_currentItem);
}
CommandBar.DrawMe();
ItemInfoLabel.DrawMe();
if(EquipItemButton.IsClicked())
{
_maestro.PlayOneShot(ButtonSound);
_controller.EquipItem(_currentItem);
}
if(UseItemButton.IsClicked())
{
_maestro.PlayOneShot(ButtonSound);
_controller.UseItem(_currentItem);
}
}
示例5: GetInventoryItem
public InventoryItem GetInventoryItem(int itemId)
{
InventoryItem aItem = new InventoryItem();
try
{
this.OpenConnection();
string sqlComm = String.Format(SqlQueries.GetQuery(Query.GetInventoryItem),
itemId);
IDataReader aReader = this.ExecuteReader(sqlComm);
if (aReader != null)
{
while (aReader.Read())
{
aItem = ItemReader(aReader);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex + " Should be input missing");
}
finally
{
this.CloseConnection();
}
return aItem;
}
示例6: DoYouHaveSpaceForThisItem
public bool DoYouHaveSpaceForThisItem(InventoryItem itemToHave)
{
if (itemToHave == null)
return false;
if(itemToHave.rpgItem.Stackable)
{
foreach(InventoryItem item in Items)
{
if(item.UniqueItemId== itemToHave.UniqueItemId && item.Level == itemToHave.Level )
return true;
}
if(!IsFullInventory)
return true;
else
return false;
}
else
{
if(maximumItems - Items.Count >= 1)
return true;
else
return false;
}
}
示例7: LoadItemInfo
public void LoadItemInfo(InventoryItem item)
{
if(icon != null)
{
GameObject atlas = Resources.Load(item.rpgItem.AtlasName) as GameObject;
icon.atlas = atlas.GetComponent<UIAtlas>();
icon.spriteName = item.rpgItem.IconPath;
}
if(nameLabel != null)
nameLabel.text = item.rpgItem.Name;
for (int i = 0; i < stars.Length; i++) {
stars[i].SetActive(false);
}
if(item.rpgItem.IsUpgradeable)
{
for (int i = 0; i < item.Level; i++) {
stars[i].SetActive(true);
}
}
if(item.IsItemEquippable && tickIcon != null)
{
if(item.IsItemEquipped)
{
tickIcon.SetActive(true);
}
else
{
tickIcon.SetActive(false);
}
}
else
{
if(tickIcon != null)
tickIcon.SetActive(false);
}
if(rarityLabel != null)
{
rarityLabel.color = GUIManager.Instance.GetRarityColor(item.rpgItem.Rarity);
rarityLabel.text = item.rpgItem.Rarity.ToString();
}
if(quantityLabel != null)
quantityLabel.text = item.CurrentAmount.ToString();
if(currencyIcon != null)
{
if(item.rpgItem.BuyCurrency == BuyCurrencyType.CitizenPoints)
currencyIcon.spriteName = GeneralData.citizenIconPath;
else if(item.rpgItem.BuyCurrency == BuyCurrencyType.Magnets)
currencyIcon.spriteName = GeneralData.magnetIconPath;
else if(item.rpgItem.BuyCurrency == BuyCurrencyType.Coins)
currencyIcon.spriteName = GeneralData.coinIconPath;
}
if(priceLabel != null)
priceLabel.text = item.rpgItem.BuyValue.ToString();
}
示例8: Contains
/*
* returns true if inventory contains at least [quantity] of [item]
*/
public bool Contains(InventoryItem item, int quantity)
{
int index = GetIndex(item);
if (index < 0) return false;
if (items[index].amount < quantity) return false;
return true;
}
示例9: AddShopItem
public void AddShopItem(InventoryItem item)
{
var spriteRenderer = GetComponent<SpriteRenderer>();
spriteRenderer.sprite = item.Sprite;
spriteRenderer.transform.localScale = item.Scale;
Item = item;
}
示例10: GetInventoryItem
public InventoryItem GetInventoryItem(int itemId)
{
InventoryItemDAO aDao = new InventoryItemDAO();
InventoryItem aInventoryItem = new InventoryItem();
aInventoryItem = aDao.GetInventoryItem(itemId);
return aInventoryItem;
}
示例11: AddItem
public bool AddItem(Room room, InventoryItem item, out InventoryItem droppedItem, ITextProcessor textProcessor)
{
Guard.NullParameter(room, () => room);
Guard.NullParameter(item, () => item);
return AddItem(room.Name, item, out droppedItem, textProcessor);
}
示例12: Start
void Start()
{
INVENTORY = new InventoryItem[InventorySize];
for(int i=0;i<INVENTORY.Length;i++){
INVENTORY[i] = new InventoryItem();
}
}
示例13: GetStockByItemidFrominventory_kitchen_stock
public Stock GetStockByItemidFrominventory_kitchen_stock(InventoryItem item)
{
Stock stock = new Stock();
StockDAO aDao = new StockDAO();
stock = aDao.GetStockByItemidFrominventory_kitchen_stock(item.ItemId);
return stock;
}
示例14: btnSearch_Click
private void btnSearch_Click(object sender, EventArgs e)
{
try
{
string partNumber = txtRestPartNumber.Text.Trim().ToString();
int version = Convert.ToInt32(txtRestVersion.Text.Trim().ToString());
InventoryItem item = new InventoryItem();
item.PartNumber = partNumber;
item.Version = version;
List<LocationQty> listLocations = PartNumberRepository.GetPartNumbersByPartNumberVersion(item);
if (listLocations.Count == 0)
{
statusLabel.ForeColor = Color.Red;
statusLabel.Text = "No PartNumber Locations availlable";
MessageBox.Show("Quantity is empty for Given PartNumber and Version","Search - PartNumber Operation",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
int totalQty = listLocations.Sum(x => x.Quantity);
listLocations.Add(new LocationQty("Total :- ", totalQty));
dgvSearchGrid.DataSource = listLocations;
}
catch (Exception exp)
{
objLogger.LogMsg(LogModes.UI, LogLevel.ERROR, "Error while Searching Location vise Part Numbers - " + exp.Message + " StackTrace:- " + exp.StackTrace);
statusLabel.ForeColor = Color.Red;
statusLabel.Text = "Error while Searching Location vise Part Numbers";
MessageBox.Show("Error while Searching Location vise Part Numbers",
"Searching - Part Number Locations", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例15: RecordAsLost
public void RecordAsLost(InventoryItem inventoryItem)
{
inventoryItem.Status = Constants.Inventory.RECORDED_AS_LOST;
inventoryItem.StatusLastChanged = DateTime.Now;
this.Save(inventoryItem);
}