// Use this for initialization void Start () { Controller = GetComponent<PlayerController>(); inventory = GetComponent<InventoryUI>(); Anim = GetComponent<Animator>(); }
void Awake() { _instance = this; InventoryManager._instance.OnInventoryChange += this.OnInventoryChange; clearupButton = transform.Find("ButtonClearup").GetComponent<UIButton>(); inventoryLabel = transform.Find("InventoryLabel").GetComponent<UILabel>(); EventDelegate ed = new EventDelegate(this,"OnClearup"); clearupButton.onClick.Add(ed); }
private int count;//记录背包中的物品数目 void Awake() { _instance = this; arrangeBtn = transform.Find("ArrangeButton").GetComponent<UIButton>(); numLabel = transform.Find("numberLabel").GetComponent<UILabel>(); //委托事件的注册 InventoryManager._instance.OnInventoryChange += this.OnInventoryChange; EventDelegate ed2 = new EventDelegate(this, "On_knapSpack_arrange_Click"); arrangeBtn.onClick.Add(ed2); }
void Start () { //Dependency "Player" player = GameObject.FindGameObjectWithTag("Player"); playerInteract = GameObject.FindGameObjectWithTag("PLAYER_interact"); plController = player.GetComponent<PlayerController>(); plInteraction = playerInteract.GetComponent<Interaction>(); //Dependency "Inventory" sprite_inventory = GameObject.FindGameObjectWithTag("GLOBAL_inventoryUI"); inventoryUI = sprite_inventory.GetComponent<InventoryUI>(); obj_camera = GameObject.FindGameObjectWithTag("GLOBAL_camera"); camMov = obj_camera.GetComponent<CameraControl>(); }
// Use this for initialization void Awake() { Instance = this; }
void Start() { invenPannel = transform.parent.GetComponent <InventoryUI>(); btn = GetComponent <Button>(); btn.onClick.AddListener(OnClick); }
public override void OnInspectorGUI() { serializedObject.Update(); //if(!slotsHeader && !shaderFold && !toggleFold && !invFold) EditorGUILayout.HelpBox("Click on a header to open the configurations!", MessageType.Info); //EditorGUILayout.Knob(new Vector2(50, 50), 1, 0, 3, "m", Color.red, Color.green, true); slotsHeader = EditorGUILayout.Foldout(slotsHeader, "Slots Configuration", true, EditorStyles.foldoutHeader); if (slotsHeader) { EditorGUILayout.Separator(); autoGenerateUI.boolValue = EditorGUILayout.Toggle(new GUIContent("Automatically generate slots"), autoGenerateUI.boolValue); if (autoGenerateUI.boolValue) { EditorGUILayout.HelpBox(new GUIContent("Parent transform for automaticaly genarated slots")); EditorGUILayout.ObjectField(generatedUIParentProp, new GUIContent("Parent transform")); EditorGUILayout.HelpBox(new GUIContent("Prefab of the slot to be instatiated")); EditorGUILayout.ObjectField(slotPrefabProp, new GUIContent("Slot prefab")); } EditorGUILayout.Separator(); EditorGUILayout.ObjectField(canvasProp, new GUIContent("Canvas where the inventory is")); EditorGUILayout.HelpBox(new GUIContent("The Rect in witch the item wont be dropped when stop draging the item")); EditorGUILayout.ObjectField(DontDropItemRectProp, new GUIContent("InventoryRect")); EditorGUILayout.Separator(); EditorGUILayout.PropertyField(useOnClickProp, new GUIContent("Use item on click")); EditorGUILayout.PropertyField(ShowAmountProp, new GUIContent("Show Amount in slots")); EditorGUILayout.Separator(); slotsFold = EditorGUILayout.Foldout(slotsFold, new GUIContent("Slots GameObjects"), true); if (slotsFold) { EditorGUI.indentLevel++; slotsProp.arraySize = EditorGUILayout.IntField("Size", slotsProp.arraySize); if (GUILayout.Button("Add seleted GameObgects to the list")) { Transform[] go = Selection.transforms; for (int i = 0; i < go.Length; i++) { if (slotsProp.GetArrayElementAtIndex(i).objectReferenceValue != null) { continue; } slotsProp.GetArrayElementAtIndex(i).objectReferenceValue = go[i].gameObject; } } for (int i = 0; i < slotsProp.arraySize; i++) { EditorGUILayout.ObjectField(slotsProp.GetArrayElementAtIndex(i), new GUIContent("Slot " + i.ToString())); } EditorGUI.indentLevel--; } EditorGUILayout.Separator(); EditorGUILayout.HelpBox(new GUIContent("The GameObject that represents a dragged item. We recomend using the default one (DragSlot prefab in UniversalInventorySystem/Prefabs/DragSlot)")); EditorGUILayout.ObjectField(dragObjProp, new GUIContent("Drag Object")); EditorGUILayout.PropertyField(serializedObject.FindProperty("hideDragObj"), new GUIContent("Hide drag object")); } EditorGUILayout.Separator(); shaderFold = EditorGUILayout.Foldout(shaderFold, "Shader Configuration", true, EditorStyles.foldoutHeader); if (shaderFold) { EditorGUILayout.HelpBox(new GUIContent("This is the color of the outline generated when draging a object (if the object provided has the inventory material)")); outlineColorProp.colorValue = EditorGUILayout.ColorField(new GUIContent("Outline color"), outlineColorProp.colorValue); outlineSizeProp.floatValue = EditorGUILayout.Slider(new GUIContent("Outline Size"), outlineSizeProp.floatValue, 0, 10); } EditorGUILayout.Separator(); toggleFold = EditorGUILayout.Foldout(toggleFold, "Toggle Inventory Configuration", true, EditorStyles.foldoutHeader); if (toggleFold) { hideInventoryProp.boolValue = EditorGUILayout.Toggle(new GUIContent("Toggle inventory by Keyboard"), hideInventoryProp.boolValue); if (hideInventoryProp.boolValue) { InventoryUI invUI = (InventoryUI)target; invUI.toggleKey = (KeyCode)EditorGUILayout.EnumPopup("Toggle key", invUI.toggleKey); EditorGUILayout.ObjectField(togglableObjectProp, new GUIContent("Togglable Object")); } } EditorGUILayout.Separator(); invFold = EditorGUILayout.Foldout(invFold, "Inventory Configuration", true, EditorStyles.foldoutHeader); if (invFold) { EditorGUILayout.PropertyField(invProp); } EditorGUILayout.Separator(); craftFold = EditorGUILayout.Foldout(craftFold, "Crafting Configuration", true, EditorStyles.foldoutHeader); if (craftFold) { /*isCraftInventoryProp = serializedObject.FindProperty("isCraftInventory"); * gridSizeProp = serializedObject.FindProperty("gridSize"); * allowsPatternCraftingProp = serializedObject.FindProperty("allowsPatternCrafting"); * productSlotsProp = serializedObject.FindProperty("productSlots");*/ EditorGUILayout.PropertyField(isCraftInventoryProp, new GUIContent("Is this a crafting inventory")); if (isCraftInventoryProp.boolValue) { EditorGUILayout.PropertyField(gridSizeProp, new GUIContent("Crafting grid size")); EditorGUILayout.PropertyField(allowsPatternCraftingProp, new GUIContent("Allows pattern crafting")); EditorGUILayout.PropertyField(productSlotsProp, new GUIContent("Product slots indexes")); EditorGUILayout.Separator(); if (hideInventoryProp.boolValue) { dropOnCloseCraftingProp.boolValue = EditorGUILayout.Toggle("Drop items on close", dropOnCloseCraftingProp.boolValue); if (dropOnCloseCraftingProp.boolValue) { dropPosProp.vector3Value = EditorGUILayout.Vector3Field("Drop position", dropPosProp.vector3Value); randomFactorProp.vector3Value = EditorGUILayout.Vector3Field("Ramdom factor", randomFactorProp.vector3Value); } } } } if (!slotsHeader && !shaderFold && !toggleFold && !invFold && !craftFold) { EditorGUILayout.HelpBox("Click on a header to open the configurations!", MessageType.Info); } serializedObject.ApplyModifiedProperties(); }
void Awake() { InventoryCaneva = GameObject.FindGameObjectWithTag("Inventory").GetComponent <InventoryUI>(); _money = 0; Items = new Item[InventorySpace]; }
private void Start() { GM = GetComponent <GameManager>(); EM = GetComponent <EmailManager>(); inventoryScreensUI = inventoryPanelUI.GetComponent <InventoryUI>(); }
void Start() { inventoryUI = InventoryUI.instance; handSlot = HandSlot.instance; status_script = this.GetComponent <player_status>(); }
// Use this for initialization void Start () { rigidbody = gameObject.GetComponent<Rigidbody>(); inventory = GameObject.Find("InventoryUI").GetComponent<InventoryUI>(); animationController = gameObject.GetComponent<playerAnimationController>(); uiModel = GameObject.Find("UiCamera").GetComponent<InventoryModelUI>(); }
public void Initialize(IItem item) { _itemInSlot = item; _inventoryUi = InventoryUI.Instance; GetComponent <Image>().sprite = _itemInSlot.Icon; }
private void Start() { // Instantiates inventoryUI = InventoryUI.instance; displayName.SetText(""); }
// Use this for initialization void Start() { inventory = FindObjectOfType <Inventory> (); inventoryUI = FindObjectOfType <InventoryUI> (); }
private void Start() { inventoryUI = GetComponent <InventoryUI>(); }
// Use this for initialization void Start() { // Initializing information about what is in inventory inventory = new GameObject[INVENTORY_SIZE]; for (int i = 0; i < inventory.Length; i++) { inventory[i] = null; } // Initializing information about how many items are in each itemAmount = new int[INVENTORY_SIZE]; for (int i = 0; i < inventory.Length; i++) { itemAmount[i] = 0; } codes = new KeyCode[] {KeyCode.Alpha1, KeyCode.Alpha2, KeyCode.Alpha3, KeyCode.Alpha4 , KeyCode.Alpha5, KeyCode.Alpha6, KeyCode.Alpha7, KeyCode.Alpha8, KeyCode.Alpha9}; placeTime = Time.time; inventoryUI = GameObject.Find ("Inventory").GetComponent<InventoryUI>(); tileParent = GameObject.Find ("Ground"); }
void Awake() { abilitySprite = emptyBox; inventoryUI = FindObjectOfType <InventoryUI>(); }
void OnEnable() { characterMovement = GetComponent <CharacterMovement>(); animator = GetComponentInChildren <Animator>(); inventoryUI = GetComponent <InventoryUI>(); }
void Awake() { seedSprite = emptyBerry; clockSprite = emptyClock; inventoryUI = FindObjectOfType <InventoryUI>(); }
void Awake() { InventoryCaneva = GameObject.FindGameObjectWithTag("Inventory").GetComponent<InventoryUI>(); _money = 0; Items = new Item[InventorySpace]; }
void Awake() { inventoryUI = FindObjectOfType <InventoryUI>(); }
private void Start() { hudManager = HudManager.Singleton; inventoryUI = HudManager.Singleton.inventoryUI; playerCenter = GameManager.Singleton.Player.centerTransform; }
CurrencySO currency;// Current item in the slot private void Start() { invUI = FindObjectOfType <InventoryUI>(); }
public void ButtonSettings() { if (PauseMenuUI.activeSelf == false) { PauseMenuUI.SetActive(true); settingsOutline.SetActive(true); vjMove.SetActive(false); viFight.SetActive(false); bInteractA.SetActive(false); bGatherB.SetActive(false); bHide.SetActive(false); SetTools(false); bMainWeapon.SetActive(false); bSwap.SetActive(false); SetQuickAccessSlots(false); bInventory.SetActive(false); if (isInventoryOpen == true) { InventoryUI.SetActive(false); } if (isChestOpen == true) { ChestUI.SetActive(false); } if (isBuildModeOn == true || isRemoveModeOn == true) { bCancel.SetActive(false); bRotate.SetActive(false); stateText.SetActive(false); } Time.timeScale = 0f; } else { settingsOutline.SetActive(false); Time.timeScale = 1f; PauseMenuUI.SetActive(false); vjMove.SetActive(true); bGatherB.SetActive(true); bHide.SetActive(true); // Check if we was in remove mode if (isRemoveModeOn == false) { bInventory.SetActive(true); bInteractA.SetActive(true); } // Check if we was on Items and the tool bar wasn't hidden, also if we wasn't in build or remove mode if (isQuickAccessSlotsSwapped == true && isShown != false && isBuildModeOn != true && isRemoveModeOn != true) { SetTools(true); bMainWeapon.SetActive(true); bSwap.SetActive(true); } // Check if we was on QASlots and the tool bar wasn't hidden, also if we wasn't in build or remove mode else if (isQuickAccessSlotsSwapped == false && isShown != false && isBuildModeOn != true && isRemoveModeOn != true) { SetQuickAccessSlots(true); bMainWeapon.SetActive(true); bSwap.SetActive(true); } // Check if inventory was open if (isInventoryOpen == true) { InventoryUI.SetActive(true); viFight.SetActive(false); bInteractA.SetActive(false); bGatherB.SetActive(false); } // Check if we was in build or remove mode if (isBuildModeOn == true || isRemoveModeOn == true) { bCancel.SetActive(true); bRotate.SetActive(true); stateText.SetActive(true); } // Check if tools for build mode was hidden if (isShownBuildTools == false) { bCancel.SetActive(false); bRotate.SetActive(false); } // Check if we wasn't in build or remove mode and inventory closed to show Visual Icon for Fight mode if (isBuildModeOn == false && isRemoveModeOn == false && isInventoryOpen != true) { viFight.SetActive(true); } } }
void Awake() { InvUI = FindObjectOfType(typeof(InventoryUI)) as InventoryUI; //Get the Inventory UI object/script. ItemInfo.gameObject.SetActive(false); }
void Start() { inventoryUI = FindObjectOfType <InventoryUI>(); inventory = FindObjectOfType <Inventory>(); if (PlayerPrefs.GetInt("SchwertComplete") == 1) { inventory.items.Add(completeSword); } if (PlayerPrefs.GetInt("SchwertComplete") == 0) { if (PlayerPrefs.GetInt("Gem") == 1) { inventory.items.Add(gem); } if (PlayerPrefs.GetInt("Schwert") == 1) { inventory.items.Add(sword); } } if (PlayerPrefs.GetInt("GimmeBoiComplete") == 1) { inventory.items.Add(completeGimmeBoi); } if (PlayerPrefs.GetInt("GimmeBoiComplete") == 0) { if (PlayerPrefs.GetInt("Batterie") == 1) { inventory.items.Add(batterie); } if (PlayerPrefs.GetInt("GimmeBoi") == 1) { inventory.items.Add(gimmeBoi); } } if (PlayerPrefs.GetInt("BesenComplete") == 1) { inventory.items.Add(completeBroom); } if (PlayerPrefs.GetInt("BesenComplete") == 0) { if (PlayerPrefs.GetInt("Besen") == 1) { inventory.items.Add(broom); } if (PlayerPrefs.GetInt("Kleiderbugel") == 1) { inventory.items.Add(hanger); } } if (PlayerPrefs.GetInt("FeuerautoComplete") == 1) { inventory.items.Add(completeFiretruck); } if (PlayerPrefs.GetInt("FeuerautoComplete") == 0) { if (PlayerPrefs.GetInt("Feuerauto") == 1) { inventory.items.Add(fireTruck); } if (PlayerPrefs.GetInt("Reifen") == 1) { inventory.items.Add(tire); } } if (PlayerPrefs.GetInt("Teddy") == 1) { inventory.items.Add(teddy); } if (PlayerPrefs.GetInt("Teddy") == 0) { if (PlayerPrefs.GetInt("Cookie") == 1) { inventory.items.Add(cookie); } } if (PlayerPrefs.GetInt("Key") == 1) { inventory.items.Add(key); } if (PlayerPrefs.GetInt("ActionFigure") == 1) { inventory.items.Add(actionFigure); } inventoryUI.UpdateUI(); }
public PlayerInventory(InventoryUI inventoryUI) { this.inventoryUI = inventoryUI; StartItems(); }
public void Awake() { inventoryUI = GameObject.Find("Canvas/Game/InventoryUI").GetComponent <InventoryUI>(); }
private void Start() { m_UI = GetComponentInParent <InventoryUI>(); m_button = GetComponentInChildren <Button>(); }
//public InventoryItem it; void Awake() { _instance = this; InventoryManager._instance.OnInventoryChange += this.OnInventoryChange; }
private void NavigateGUI(int direction, InventoryUI GUI) { GUI.Navigate(direction); }
void Awake() { inventoryUi = GetComponentInParent <InventoryUI>(); }
private void Awake() { instance = this; }
public void SetManager(InventoryUI manager) { this.manager = manager; }
// Start is called before the first frame update void Start() { inventory = GameObject.FindGameObjectWithTag("Submarine").GetComponent <InventoryUI>(); }
private void Awake() { instance = this; ui = GetComponentInChildren <InventoryUI>(); statsUI = GetComponentInChildren <CharacterStatsUI>(); }
public InventoryItemSelectedEventArgs(InventoryUI inventoryUI, Attachable item) { InventoryUI = inventoryUI; Item = item; }
void Awake() { instance = this; }