public void OnPointerEnter(PointerEventData eventData) { if (displayInfo != null) { if (!displayInfo.isArtifact) { PlayerProperties.toolTip.SetTextAndPosition(displayInfo.GetComponent <Text>().text, transform.position); } else { ArtifactBonus artifactBonus = displayInfo.GetComponent <ArtifactBonus>(); PlayerProperties.artifactToolTip.SetTextAndPosition( artifactBonus.artifactName, artifactBonus.descriptionText.text, artifactBonus.effectText == null ? "" : artifactBonus.effectText.text, artifactBonus.attackBonus, artifactBonus.speedBonus, artifactBonus.healthBonus, artifactBonus.defenseBonus, artifactBonus.periodicHealing, displayInfo.hasActive, displayInfo.soulBound, artifactBonus.killRequirement, artifactBonus.whatRarity, transform.position); } } }
public void deleteItem() { if (displayInfo != null && Input.GetKey(KeyCode.LeftShift) && SceneManager.GetActiveScene().name != "Tutorial" && FindObjectOfType <ConsumableConfirm>() == null) { FindObjectOfType <AudioManager>().PlaySound("Destroy Item"); inventory.itemList.Remove(displayInfo.gameObject); if (displayInfo.GetComponent <ArtifactEffect>()) { displayInfo.GetComponent <ArtifactEffect>().artifactDestroyed(); } Destroy(displayInfo.gameObject); displayInfo = null; } }
public void OnPointerEnter(PointerEventData eventData) { if (displayInfo != null) { toolTip.SetActive(true); toolTip.transform.position = this.transform.position; toolTip.GetComponentInChildren <Text>().text = displayInfo.GetComponent <Text>().text; } }
void UpdateUI() { artifragmentsText.text = PlayerUpgrades.numberArtifragments.ToString(); if (targetDisplayItem == null) { artifactIcon.enabled = false; fragmentsReceivedText.color = new Color(0, 1, 0.9717827f, 0); fragmentsTextActive = false; } else { artifactIcon.enabled = true; artifactIcon.sprite = targetDisplayItem.displayIcon; ArtifactBonus artifactBonus = targetDisplayItem.GetComponent <ArtifactBonus>(); fragmentsReceivedText.text = determinePrice(artifactBonus.whatRarity, artifactBonus.whatDungeonArtifact).ToString() + " Fragments"; fragmentsTextActive = true; fragmentsReceivedText.color = variedColor; } }
public void enterToolTip() { if (displayInfo != null) { if (displayInfo.isArtifact) { ArtifactBonus artifactBonus = displayInfo.GetComponent <ArtifactBonus>(); PlayerProperties.artifactToolTip.SetTextAndPosition( artifactBonus.artifactName, artifactBonus.descriptionText.text, artifactBonus.effectText == null ? "" : artifactBonus.effectText.text, artifactBonus.attackBonus, artifactBonus.speedBonus, artifactBonus.healthBonus, artifactBonus.defenseBonus, artifactBonus.periodicHealing, displayInfo.hasActive, displayInfo.soulBound, artifactBonus.killRequirement, artifactBonus.whatRarity, transform.position); } else if (displayInfo.isConsumable) { ConsumableBonus consumableBonus = displayInfo.GetComponent <ConsumableBonus>(); PlayerProperties.consumableToolTip.SetTextAndPosition( consumableBonus.consumableName, consumableBonus.loreText.text, consumableBonus.effectText == null ? "" : consumableBonus.effectText.text, consumableBonus.attackBonus, consumableBonus.speedBonus, consumableBonus.defenseBonus, consumableBonus.restoredHealth, consumableBonus.duration, transform.position); } else { PlayerProperties.toolTip.SetTextAndPosition(displayInfo.GetComponent <Text>().text, transform.position); } } }
public void removeArtifact() { if (displayInfo != null && inventory.itemList.Count < inventory.inventorySlots.Length && GameObject.Find("PlayerShip").GetComponent <PlayerScript>().enemiesDefeated == true && FindObjectOfType <ConsumableConfirm>() == null) { if (inventory.itemList.Count < inventory.inventorySize) { displayInfo.isEquipped = false; ArtifactEffect artifactEffect = displayInfo.GetComponent <ArtifactEffect>(); if (artifactEffect != null) { artifactEffect.artifactUnequipped(); } artifacts.activeArtifacts.Remove(displayInfo.gameObject); inventory.itemList.Add(displayInfo.gameObject); inventory.UpdateUI(); artifacts.UpdateUI(); PlayerProperties.playerScript.CheckAndUpdateHealth(); } } }