• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# InventoryItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InventoryItem的典型用法代码示例。如果您正苦于以下问题:C# InventoryItem类的具体用法?C# InventoryItem怎么用?C# InventoryItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InventoryItem类属于命名空间,在下文中一共展示了InventoryItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
 }
开发者ID:1510649869,项目名称:ARPG_project,代码行数:28,代码来源:EquipPopup.cs


示例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;
        }
开发者ID:seanlin816,项目名称:NetsuiteAPI,代码行数:34,代码来源:Item.cs


示例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;
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:27,代码来源:InventoryImage.cs


示例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);
		}
	}
开发者ID:Asvarduil,项目名称:Sara-The-Shieldmage,代码行数:26,代码来源:InventoryPresenter.cs


示例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;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:32,代码来源:InventoryItemDAO.cs


示例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;
		}
	}
开发者ID:reaganq,项目名称:MagnetBots_unity,代码行数:27,代码来源:BasicInventory.cs


示例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();

	}
开发者ID:reaganq,项目名称:MagnetBots_unity,代码行数:60,代码来源:ItemInfoBox.cs


示例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;
 }
开发者ID:Torppo,项目名称:IntramuralRPG,代码行数:10,代码来源:Inventory.cs


示例9: AddShopItem

 public void AddShopItem(InventoryItem item)
 {
     var spriteRenderer = GetComponent<SpriteRenderer>();
     spriteRenderer.sprite = item.Sprite;
     spriteRenderer.transform.localScale = item.Scale;
     Item = item;
 }
开发者ID:sasuke010101,项目名称:A-Unity2D-Game,代码行数:7,代码来源:ShopSlot.cs


示例10: GetInventoryItem

 public InventoryItem GetInventoryItem(int itemId)
 {
     InventoryItemDAO aDao = new InventoryItemDAO();
        InventoryItem aInventoryItem = new InventoryItem();
        aInventoryItem = aDao.GetInventoryItem(itemId);
        return aInventoryItem;
 }
开发者ID:Jusharra,项目名称:RMS,代码行数:7,代码来源:InventoryItemBLL.cs


示例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);
        }
开发者ID:CompileThis,项目名称:CompileThis.BawBag,代码行数:7,代码来源:InventoryManager.cs


示例12: Start

 void Start()
 {
     INVENTORY = new InventoryItem[InventorySize];
     for(int i=0;i<INVENTORY.Length;i++){
         INVENTORY[i] = new InventoryItem();
     }
 }
开发者ID:endles-nameles,项目名称:eslsg,代码行数:7,代码来源:PlayerInventory.cs


示例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;
 }
开发者ID:Jusharra,项目名称:RMS,代码行数:7,代码来源:StockBLL.cs


示例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);
            }
        }
开发者ID:akshayjoyinfo,项目名称:Part-Number-Store-App,代码行数:31,代码来源:frmMainUI.cs


示例15: RecordAsLost

        public void RecordAsLost(InventoryItem inventoryItem)
        {
            inventoryItem.Status = Constants.Inventory.RECORDED_AS_LOST;
            inventoryItem.StatusLastChanged = DateTime.Now;

            this.Save(inventoryItem);
        }
开发者ID:OneTechieMom,项目名称:ShoeInventoryManager_Backend,代码行数:7,代码来源:InventoryItemRepository.cs


示例16: LoadPlayerInventory

    //! Loads player data as json string to PlayerPrefs \todo pseudo code -> code
    public List<InventoryItem> LoadPlayerInventory()
    {
        //create list of inventory items to hold the inventory to return
        List <InventoryItem> inventoryLoad = new List <InventoryItem>();

        //if the inventory key doesnt exist return the empty list
        if(!PlayerPrefs.HasKey("PlayerInventory"))
        {
            return inventoryLoad;
        }

        //obtain the inventory string from the playerprefs and fill the list of inventory items
        JSONNode loadedPlayerInventory = JSONClass.Parse(PlayerPrefs.GetString("PlayerInventory"));

        List<string> keyList = loadedPlayerInventory.Keys.ToList ();

        for(int count = 0; count < keyList.Count; count++)
        {
            //loads the inventory in the order the setter functions appear in the inventory item script
            string tempName = loadedPlayerInventory["Inventory"][count][0];
            int tempType = loadedPlayerInventory["Inventory"][count][1].AsInt;
            string tempDescription = loadedPlayerInventory["Inventory"][count][2];
            int tempValue = loadedPlayerInventory["Inventory"][count][3].AsInt;
            int tempAmount = loadedPlayerInventory["Inventory"][count][4].AsInt;
            int tempID = loadedPlayerInventory["Inventory"][count][5].AsInt;

            //create the inventory item and add it to the list
            InventoryItem new_item = new InventoryItem(tempName, tempID, tempDescription, tempValue, tempAmount, tempType);
            inventoryLoad.Add(new_item);
        }

        //return the list of created inventory items
        return inventoryLoad;
    }
开发者ID:chicostategamestudios,项目名称:qk-pop,代码行数:35,代码来源:PlayerSaveManager.cs


示例17: Request

        public void Request(InventoryItem inventoryItem)
        {
            inventoryItem.Status = Constants.Inventory.REQUESTED;
            inventoryItem.StatusLastChanged = DateTime.Now;

            this.Save(inventoryItem);
        }
开发者ID:OneTechieMom,项目名称:ShoeInventoryManager_Backend,代码行数:7,代码来源:InventoryItemRepository.cs


示例18: button3_Click

        private void button3_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtLocation.Text))
            {
                InventoryItem item = new InventoryItem();
                item.Location = txtLocation.Text;
                bool locationExist = PartNumberRepository.CheckPartLocaionExist(item);

                if (!locationExist)
                {
                    bool addStatus = PartNumberRepository.AddLocationColumn(txtLocation.Text);
                    if(addStatus)
                        MessageBox.Show("Location Added successfully", "Location", MessageBoxButtons.OK,
                          MessageBoxIcon.Asterisk);
                    else
                    {
                        MessageBox.Show("Unable to Add Location", "Location", MessageBoxButtons.OK,
                          MessageBoxIcon.Asterisk);
                    }
                }
                else
                {
                    MessageBox.Show("Location already exist", "Location", MessageBoxButtons.OK,
                          MessageBoxIcon.Asterisk);
                }
            }
            else
            {
                MessageBox.Show("Location should not be empty", "Location", MessageBoxButtons.OK,
                          MessageBoxIcon.Asterisk);
            }
            txtLocation.Clear();
        }
开发者ID:akshayjoyinfo,项目名称:Part-Number-Store-App,代码行数:33,代码来源:frmAdminPanel.cs


示例19: ItemTriggered

    //--------------------------------------------------------------------------
    // skills
    //--------------------------------------------------------------------------
    public static void ItemTriggered(InventoryItem item)
    {
        if (Time.time - _triggerTime > 1)
        {
            _triggeredItems.Clear();
        }
        _triggeredItems.Add(item);
        _triggerTime = Time.time;

        foreach (Skill skill in SkillDatabase.Skills)
        {
            // 1. Compare the Count
            if (skill._triggerSequence.Count == _triggeredItems.Count)
            {
                // 2. Compare the sequence
                bool match = true;
                for (int i=0; i<skill._triggerSequence.Count; i++)
                {
                    if (skill._triggerSequence[i] !=_triggeredItems[i])
                    {
                        match = false;
                        break;
                    }
                }
                if (match)
                {
                    PlayerController._playerController.UseSkill(skill);
                    _triggeredItems.Clear();
                    return;
                }
            }
        }
    }
开发者ID:PaulSchweizer,项目名称:GameDev,代码行数:36,代码来源:PlayerController.cs


示例20: InventoryUpdateCRC

        /*
            // Confirm InventoryUpdate CRC
            uint test = libsecondlife.Packets.InventoryPackets.InventoryUpdateCRC
                        (
                            (int)1159214416
                            , (byte)0
                            , (sbyte)7
                            , (sbyte)7
                            , (LLUUID)"00000000000000000000000000000000"
                            , (LLUUID)"00000000000000000000000000000000"
                            , (int)10
                            , (LLUUID)"25472683cb324516904a6cd0ecabf128"
                            , (LLUUID)"25472683cb324516904a6cd0ecabf128"
                            , (LLUUID)"77364021f09f13dfb692f036be53b9e2"
                            , (LLUUID)"a4947fc066c247518d9854aaf90097f4"
                            , (uint)0
                            , (uint)0
                            , (uint)2147483647
                            , (uint)0
                            , (uint)2147483647
                        );

            if( test != (uint)895206313 )
            {
                Console.WriteLine("CRC Generation is no longer correct.");
                return;
            }
        */
        public static uint InventoryUpdateCRC(InventoryItem iitem)
        {
            uint CRC = 0;

            /* IDs */
            CRC += iitem.AssetID.CRC(); // AssetID
            CRC += iitem.FolderID.CRC(); // FolderID
            CRC += iitem.ItemID == null ? LLUUID.Zero.CRC() : iitem.ItemID.CRC(); // ItemID

            /* Permission stuff */
            CRC += iitem.CreatorID.CRC(); // CreatorID
            CRC += iitem.OwnerID.CRC(); // OwnerID
            CRC += iitem.GroupID.CRC(); // GroupID

            /* CRC += another 4 words which always seem to be zero -- unclear if this is a LLUUID or what */
            CRC += iitem.OwnerMask; //owner_mask;      // Either owner_mask or next_owner_mask may need to be
            CRC += iitem.NextOwnerMask; //next_owner_mask; // switched with base_mask -- 2 values go here and in my
            CRC += iitem.EveryoneMask; //everyone_mask;   // study item, the three were identical.
            CRC += iitem.GroupMask; //group_mask;

            /* The rest of the CRC fields */
            CRC += iitem.Flags; // Flags
            CRC += (uint)iitem.InvType; // InvType
            CRC += (uint)iitem.Type; // Type
            CRC += (uint)iitem.CreationDate; // CreationDate
            CRC += (uint)iitem.SalePrice;    // SalePrice
            CRC += (uint)((uint)iitem.SaleType * 0x07073096); // SaleType

            return CRC;
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:58,代码来源:InventoryPacketHelper.cs



注:本文中的InventoryItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InventoryItemBase类代码示例发布时间:2022-05-24
下一篇:
C# InventoryFolderBase类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap