当前位置: 首页>>代码示例>>C#>>正文


C# AC.InvItem类代码示例

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


InvItem类属于AC命名空间,在下文中一共展示了InvItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InvItem

		public InvItem (InvItem assetItem)
		{
			count = assetItem.count;
			tex = assetItem.tex;
			activeTex = assetItem.activeTex;
			carryOnStart = assetItem.carryOnStart;
			canCarryMultiple = assetItem.canCarryMultiple;
			label = assetItem.label;
			altLabel = assetItem.altLabel;
			id = assetItem.id;
			lineID = assetItem.lineID;
			useIconID = assetItem.useIconID;
			binID = assetItem.binID;
			useSeparateSlots = assetItem.useSeparateSlots;
			isEditing = false;
			recipeSlot = -1;
			
			useActionList = assetItem.useActionList;
			lookActionList = assetItem.lookActionList;
			interactions = assetItem.interactions;
			combineActionList = assetItem.combineActionList;
			unhandledActionList = assetItem.unhandledActionList;
			unhandledCombineActionList = assetItem.unhandledCombineActionList;
			combineID = assetItem.combineID;
		}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:25,代码来源:InvItem.cs

示例2: HighlightItemOnInstant

 /**
  * <summary>Fully highlights an inventory item instantly.</summary>
  * <param name = "_id">The ID number of the inventory item (see InvItem) to highlight</param>
  */
 public void HighlightItemOnInstant(int _id)
 {
     highlightItem = GetItem (_id);
     highlightState = HighlightState.None;
     pulse = 1f;
 }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:10,代码来源:RuntimeInventory.cs

示例3: InsertAt

        /**
         * <summary>Adds an inventory item to the Container's contents, at a particular index.</summary>
         * <param name = "_item">The InvItem to place within the Container</param>
         * <param name = "_index">The index number within the Container's current contents to insert the new item</param>
         */
        public void InsertAt(InvItem _item, int _index)
        {
            ContainerItem newContainerItem = new ContainerItem (_item.id, GetIDArray ());
            newContainerItem.count = _item.count;

            if (items.Count <= _index)
            {
                items.Add (newContainerItem);
            }
            else
            {
                items.Insert (_index, newContainerItem);
            }
        }
开发者ID:mcbodge,项目名称:eidolon,代码行数:19,代码来源:Container.cs

示例4: GetPropertyDisplayValue

 private string GetPropertyDisplayValue(int languageNumber, InvItem invItem)
 {
     if (invItem != null)
     {
         InvVar invVar = invItem.GetProperty (itemPropertyID);
         if (invVar != null)
         {
             return invVar.GetDisplayValue (languageNumber);
         }
     }
     return "";
 }
开发者ID:mcbodge,项目名称:eidolon,代码行数:12,代码来源:MenuLabel.cs

示例5: DeactivateAllItems

		private void DeactivateAllItems ()
		{
			foreach (InvItem item in items)
			{
				item.isEditing = false;
			}
			selectedItem = null;
		}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:8,代码来源:InventoryManager.cs

示例6: CreateItemsGUI

		private void CreateItemsGUI ()
		{
			EditorGUILayout.LabelField ("Inventory items", EditorStyles.boldLabel);

			filter = EditorGUILayout.TextField ("Filter by name:", filter);
			EditorGUILayout.Space ();

			foreach (InvItem item in items)
			{
				if (filter == "" || item.label.ToLower ().Contains (filter.ToLower ()))
				{
					EditorGUILayout.BeginHorizontal ();
					
					string buttonLabel = item.label;
					if (buttonLabel == "")
					{
						buttonLabel = "(Untitled)";	
					}

					if (GUILayout.Toggle (item.isEditing, item.id + ": " + buttonLabel, "Button"))
					{
						if (selectedItem != item)
						{
							DeactivateAllItems ();
							ActivateItem (item);
						}
					}

					if (GUILayout.Button (sideIcon, GUILayout.Width (20f), GUILayout.Height (15f)))
					{
						SideMenu (item);
					}

					EditorGUILayout.EndHorizontal ();
				}
			}

			if (GUILayout.Button("Create new item"))
			{
				Undo.RecordObject (this, "Create inventory item");

				ResetFilter ();
				InvItem newItem = new InvItem (GetIDArray ());
				items.Add (newItem);
				DeactivateAllItems ();
				ActivateItem (newItem);
			}
		}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:48,代码来源:InventoryManager.cs

示例7: DrawTexture

        private void DrawTexture(Rect rect, InvItem _item, bool isActive)
        {
            if (_item == null) return;

            Texture2D tex = null;
            if (Application.isPlaying && KickStarter.runtimeInventory != null && inventoryBoxType != AC_InventoryBoxType.DisplaySelected)
            {
                if (_item == KickStarter.runtimeInventory.highlightItem && _item.activeTex != null)
                {
                    KickStarter.runtimeInventory.DrawHighlighted (rect);
                    return;
                }

                if (_item.activeTex != null && ((isActive && KickStarter.settingsManager.activeWhenHover) || _item == KickStarter.runtimeInventory.selectedItem))
                {
                    tex = _item.activeTex;
                }
                else if (_item.tex != null)
                {
                    tex = _item.tex;
                }
            }
            else if (_item.tex != null)
            {
                tex = _item.tex;
            }

            if (tex != null)
            {
                GUI.DrawTexture (rect, tex, ScaleMode.StretchToFill, true, 0f);
            }
        }
开发者ID:farreltr,项目名称:OneLastSunset,代码行数:32,代码来源:MenuInventoryBox.cs

示例8: InvItem

        public InvItem(InvItem assetItem)
        {
            count = assetItem.count;
            tex = assetItem.tex;
            activeTex = assetItem.activeTex;
            carryOnStart = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID = assetItem.carryOnStartID;
            canCarryMultiple = assetItem.canCarryMultiple;
            label = assetItem.label;
            altLabel = assetItem.altLabel;
            id = assetItem.id;
            lineID = assetItem.lineID;
            useIconID = assetItem.useIconID;
            binID = assetItem.binID;
            useSeparateSlots = assetItem.useSeparateSlots;
            isEditing = false;
            recipeSlot = -1;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1 = assetItem.hotspotPrefix1;
            hotspotPrefix2 = assetItem.hotspotPrefix2;

            useActionList = assetItem.useActionList;
            lookActionList = assetItem.lookActionList;
            interactions = assetItem.interactions;
            combineActionList = assetItem.combineActionList;
            unhandledActionList = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID = assetItem.combineID;
        }
开发者ID:IJkeB,项目名称:Ekster_Final,代码行数:31,代码来源:InvItem.cs

示例9: RebuildProperties

        private void RebuildProperties(InvItem item)
        {
            // Which properties are available?
            List<int> availableVarIDs = new List<int>();
            foreach (InvVar invVar in invVars)
            {
                if (!invVar.limitToCategories || bins.Count == 0 || invVar.categoryIDs.Contains (item.binID))
                {
                    availableVarIDs.Add (invVar.id);
                }
            }

            // Create new properties / transfer existing values
            List<InvVar> newInvVars = new List<InvVar>();
            foreach (InvVar invVar in invVars)
            {
                if (availableVarIDs.Contains (invVar.id))
                {
                    InvVar newInvVar = new InvVar (invVar);
                    InvVar oldInvVar = item.GetProperty (invVar.id);
                    if (oldInvVar != null)
                    {
                        newInvVar.TransferValues (oldInvVar);
                    }
                    newInvVars.Add (newInvVar);
                }
            }

            item.vars = newInvVars;
        }
开发者ID:mcbodge,项目名称:eidolon,代码行数:30,代码来源:InventoryManager.cs

示例10: ExtractInventory

		private void ExtractInventory (InvItem invItem, bool onlySeekNew)
		{
			if (onlySeekNew && invItem.lineID == -1)
			{
				// Assign a new ID on creation
				SpeechLine newLine;
				if (invItem.altLabel != "")
				{
					newLine = new SpeechLine (GetIDArray(), EditorApplication.currentScene, invItem.altLabel, languages.Count - 1, AC_TextType.InventoryItem);
				}
				else
				{
					newLine = new SpeechLine (GetIDArray(), EditorApplication.currentScene, invItem.label, languages.Count - 1, AC_TextType.InventoryItem);
				}
				invItem.lineID = newLine.lineID;
				lines.Add (newLine);
			}
			
			else if (!onlySeekNew && invItem.lineID > -1)
			{
				// Already has an ID, so don't replace
				if (invItem.altLabel != "")
				{
					lines.Add (new SpeechLine (invItem.lineID, EditorApplication.currentScene, invItem.altLabel, languages.Count - 1, AC_TextType.InventoryItem));
				}
				else
				{
					lines.Add (new SpeechLine (invItem.lineID, EditorApplication.currentScene, invItem.label, languages.Count - 1, AC_TextType.InventoryItem));
				}
			}
		}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:31,代码来源:SpeechManager.cs

示例11: Remove

        /**
         * <summary>Removes an inventory item from the player's inventory.</summary>
         * <param name = "_item">The inventory item (InvItem) to remove</param>
         */
        public void Remove(InvItem _item)
        {
            if (_item != null && localItems.Contains (_item))
            {
                if (_item == selectedItem)
                {
                    SetNull ();
                }

                localItems [localItems.IndexOf (_item)] = null;

                localItems = ReorderItems (localItems);
                localItems = RemoveEmptySlots (localItems);
            }
        }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:19,代码来源:RuntimeInventory.cs

示例12: MoveItemToIndex

        /**
         * <summary>Moves an item already in an inventory to a different slot.</summary>
         * <param name = "item">The inventory item to move</param>
         * <param name = "items">The List of inventory items that the item is to be moved within</param>
         * <param name = "index">The index number of the MenuInventoryBox slot to move the item to</param>
         * <returns>The re-ordered List of inventory items</returns>
         */
        public List<InvItem> MoveItemToIndex(InvItem item, List<InvItem> items, int index)
        {
            if (item != null)
            {
                if (KickStarter.settingsManager.canReorderItems)
                {
                    // Check nothing in place already
                    int oldIndex = items.IndexOf (item);
                    while (items.Count <= Mathf.Max (index, oldIndex))
                    {
                        items.Add (null);
                    }

                    if (items [index] == null)
                    {
                        items [index] = item;
                        items [oldIndex] = null;
                    }

                    SetNull ();
                    items = RemoveEmptySlots (items);
                }
                else if (items.IndexOf (item) == index)
                {
                    SetNull ();
                }
            }
            return items;
        }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:36,代码来源:RuntimeInventory.cs

示例13: Look

        /**
         * <summary>Runs an inventory item's "Examine" interaction.</summary>
         * <param name = "item">The inventory item to examine</param>
         */
        public void Look(InvItem item)
        {
            if (item == null || item.recipeSlot > -1) return;

            if (item.lookActionList)
            {
                AdvGame.RunActionListAsset (item.lookActionList);
            }
        }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:13,代码来源:RuntimeInventory.cs

示例14: RemoveRecipes

        /**
         * Resets any active recipe, and clears all MenuCrafting elements.
         */
        /*
        public void RemoveRecipes ()
        {
            while (craftingItems.Count > 0)
            {
                for (int i=0; i<craftingItems.Count; i++)
                {
                    Add (craftingItems[i].id, craftingItems[i].count, false, -1);
                    craftingItems.RemoveAt (i);
                }
            }
            PlayerMenus.ResetInventoryBoxes ();
        }*/
        /**
         * <summary>Moves an ingredient from a crafting recipe back into the player's inventory.</summary>
         * <param name = "_recipeSlot">The index number of the MenuCrafting slot that the ingredient was placed in</param>
         * <param name = "selectAfter">If True, the inventory item will be selected once the transfer is complete</param>
         */
        /*
        public void TransferCraftingToLocal (int _recipeSlot, bool selectAfter)
        {
            foreach (InvItem item in craftingItems)
            {
                if (item.recipeSlot == _recipeSlot)
                {
                    Add (item.id, item.count, selectAfter, -1);
                    SelectItemByID (item.id, SelectItemMode.Use);
                    craftingItems.Remove (item);
                    return;
                }
            }
        }*/
        /**
         * <summary>Moves an ingredient from the player's inventory into a crafting recipe as an ingredient.</summary>
         * <param name = "_item">The inventory item to transfer</param>
         * <param name = "_slot">The index number of the MenuCrafting slot to place the item in</param>
         */
        /*
        public void TransferLocalToCrafting (InvItem _item, int _slot)
        {
            if (_item != null && localItems.Contains (_item))
            {
                _item.recipeSlot = _slot;
                craftingItems.Add (_item);

                localItems [localItems.IndexOf (_item)] = null;
                localItems = ReorderItems (localItems);
                localItems = RemoveEmptySlots (localItems);

                SetNull ();
            }
        }*/
        /**
         * <summary>Gets a list of inventory items associated with the interactions of the current Hotspot or item being hovered over.</summary>
         * <returns>A list of inventory items associated with the interactions of the current Hotspot or item being hovered over</returns>
         */
        /*
        public List<InvItem> MatchInteractions ()
        {
            List<InvItem> items = new List<InvItem>();
            matchingInvInteractions = new List<int>();

            if (!KickStarter.settingsManager.cycleInventoryCursors)
            {
                return items;
            }

            if (hoverItem != null)
            {
                items = MatchInteractionsFromItem (items, hoverItem);
            }
            else if (KickStarter.playerInteraction.GetActiveHotspot ())
            {
                List<Button> invButtons = KickStarter.playerInteraction.GetActiveHotspot ().invButtons;
                foreach (Button button in invButtons)
                {
                    foreach (InvItem item in localItems)
                    {
                        if (item != null && item.id == button.invID && !button.isDisabled)
                        {
                            matchingInvInteractions.Add (invButtons.IndexOf (button));
                            items.Add (item);
                            break;
                        }
                    }
                }
            }
            return items;
        }*/
        private List<InvItem> MatchInteractionsFromItem(List<InvItem> items, InvItem _item)
        {
            if (_item != null && _item.combineID != null)
            {
                foreach (int combineID in _item.combineID)
                {
                    foreach (InvItem item in localItems)
                    {
//.........这里部分代码省略.........
开发者ID:BenBarahona,项目名称:MayanExtinction,代码行数:101,代码来源:RuntimeInventory.cs

示例15: DoesHaveInventoryInteraction

        public bool DoesHaveInventoryInteraction(InvItem invItem)
        {
            if (invItem != null)
            {
                foreach (int invID in combineID)
                {
                    if (invID == invItem.id)
                    {
                        return true;
                    }
                }
            }

            return false;
        }
开发者ID:IJkeB,项目名称:Ekster_Final,代码行数:15,代码来源:InvItem.cs


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