public void EnterCraftMode(CollectionCardVisual cardToDisplay) { if (!this.m_cancellingCraftMode && !CollectionDeckTray.Get().IsWaitingToDeleteDeck()) { CollectionManagerDisplay.Get().HideAllTips(); this.m_arcaneDustBalance = NetCache.Get().GetNetObject <NetCache.NetCacheArcaneDustBalance>().Balance; this.m_offClickCatcher.enabled = true; KeywordHelpPanelManager.Get().HideKeywordHelp(); this.MoveCardToBigSpot(cardToDisplay, true); if (this.m_craftingUI == null) { string name = (UniversalInputManager.UsePhoneUI == null) ? "CraftingUI" : "CraftingUI_Phone"; this.m_craftingUI = AssetLoader.Get().LoadGameObject(name, true, false).GetComponent <CraftingUI>(); this.m_craftingUI.SetStartingActive(); GameUtils.SetParent(this.m_craftingUI, this.m_showCraftingUIBone.gameObject, false); } if ((this.m_cardInfoPane == null) && (UniversalInputManager.UsePhoneUI == null)) { this.m_cardInfoPane = AssetLoader.Get().LoadGameObject("CardInfoPane", true, false).GetComponent <CardInfoPane>(); } this.m_craftingUI.gameObject.SetActive(true); this.m_craftingUI.Enable(this.m_showCraftingUIBone.position, this.m_hideCraftingUIBone.position); this.FadeEffectsIn(); this.UpdateCardInfoPane(); Navigation.Push(new Navigation.NavigateBackHandler(this.CancelCraftMode)); } }
public void CloseCraftScreen() { CraftingUI.SetActive(false); if (isQuickAccessSlotsSwapped == true && isShown != false) { SetTools(true); bMainWeapon.SetActive(true); bSwap.SetActive(true); } else if (isQuickAccessSlotsSwapped == false && isShown != false) { SetQuickAccessSlots(true); bMainWeapon.SetActive(true); bSwap.SetActive(true); } bHide.SetActive(true); bInventory.SetActive(true); bSettings.SetActive(true); vjMove.SetActive(true); bInteractA.SetActive(true); bGatherB.SetActive(true); viFight.SetActive(true); xpBar.SetActive(true); }
void InitInstance() { if (Instance != null) { Debug.Log("More than on crafting UI created!"); } Instance = this; }
// Use this for initialization void Awake() { Instance = this; CraftingMaterialsContainer.transform.DestroyChildren(); SelectedCraftItemImage.color = Color.clear; var p = GetObject.PlayerMonoGameObject; if (p != null) { playerTransform = p.transform; } }
private void Start() { CraftingUI craftingUI = FindObjectOfType <CraftingUI>(); inventory = FindObjectOfType <Inventory>(); foreach (Recipe recipe in recipes) { if (recipes != null) { craftingUI.AddItemToUI(recipe); } } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } InventoryUI = GetComponent <InventoryUI>(); CraftingUI = GetComponent <CraftingUI>(); }
void Awake() { Instance = this; }
public void Start() { player = GameManager.playerObject.GetComponent <Player>(); crafting = GameManager.instance.GetComponent <CraftingUI>(); image = GetComponent <Image>(); }
void Start() { crafting = GameObject.Find("craftingui").GetComponent <CraftingUI>(); }
private void Start() { playerManager = FindObjectOfType <PlayerManager>(); GetComponent <Renderer>().sortingOrder = (int)(gameObject.transform.position.y * -100); craftingUI = playerManager.craftingUI; }
// Start is called before the first frame update void Start() { filterMining = new ContactFilter2D(); filterMining.useLayerMask = true; filterMining.layerMask = layerMaskMining; filterMining.useTriggers = true; filter = new ContactFilter2D(); filter.useLayerMask = true; filter.layerMask = layerMask; filter.useTriggers = false; placeSprite = Instantiate(placeSpritePrefab, Vector3.zero, Quaternion.identity); Inventory[] inventories = GetComponents <Inventory>(); for (int i = 0; i < inventories.Length; i++) { if (inventories[i] is AmmoSlot) { ammoInventory = inventories[i] as AmmoSlot; } else { playerInventory = inventories[i]; } } playerInventory = GetComponent <Inventory>(); placeSpriteRenderer = placeSprite.GetComponent <SpriteRenderer>(); Camera.main.GetComponent <CameraFollow>().SetCameraTarget(this.gameObject); placeGrid = GameObject.FindGameObjectWithTag("Grid").GetComponent <Grid>(); canvas = GameObject.Find("Canvas"); machinePanelInteract = Instantiate(machinePanelInteractPrefab, canvas.transform); inventoryInteract = Instantiate(inventoryPanelInteractPrefab, canvas.transform); inventoryPanel = Instantiate(inventoryPanelPrefab, canvas.transform); craftingPanel = Instantiate(craftingPanelPrefab, canvas.transform); inventoryAmmo = Instantiate(ammoInventoryPrefab, canvas.transform); mouseInventoryUI = Instantiate(mouseInventoryPrefab, canvas.transform); tooltip = Instantiate(tooltipPanelPrefab, canvas.transform); filterItemPanel = Instantiate(filterItemPanelPrefab, canvas.transform); mouseInventoryUI.GetComponent <InventoryMouse>().SetInventory(mouseInventory); machineUI = machinePanelInteract.GetComponentInChildren <MachineUI>(); inventoryInteractUI = inventoryInteract.GetComponentInChildren <InventoryUI>(); inventoryUI = inventoryPanel.GetComponentInChildren <InventoryUI>(); craftingUI = craftingPanel.GetComponentInChildren <CraftingUI>(); inventoryAmmoUI = inventoryAmmo.GetComponentInChildren <InventoryUI>(); ammoSlotSelected = inventoryAmmo.GetComponentInChildren <HighlightSlotUI>(); filterItemUI = filterItemPanel.GetComponent <UIFilterItem>(); inventoryAmmoUI.SetViewedInventory(ammoInventory); inventoryAmmoUI.SetMouseInventory(mouseInventory); inventoryUI.SetViewedInventory(playerInventory); inventoryUI.SetMouseInventory(mouseInventory); inventoryInteractUI.SetMouseInventory(mouseInventory); craftingUI.SetLinkedInventory(playerInventory); machineUI.SetMouseInventory(mouseInventory); characterAlliance = AllianceDefinitions.Instance.GetAlliance("Character"); this.gameObject.GetComponent <Health>().alliance = characterAlliance.allianceCode; }
private void Start() { craftingUI = GetComponentInParent <CraftingUI>(); buttonImage = GetComponent <Image>(); }