public void OnBeginDrag(PointerEventData eventData) { if (itemDataInfo.Item != null) { this.transform.SetParent(this.transform.parent.parent); this.transform.position = eventData.position - offset; GetComponent <CanvasGroup>().blocksRaycasts = false; tooltip.Activate(ItemDataInfo); } }
public void OnPointerEnter(PointerEventData eventData) { print("Enter Test"); Item i1 = _item_manager.FetchItemById(4); _tooltip.Activate(i1, 1, true); }
public void OnPointerEnter(PointerEventData eventData) { if (item != null) { tooltip.Activate(item); } }
public void OnPointerEnter(PointerEventData eventData) { if (ItemIsValid()) { tooltip.Activate(item); } }
public void OnPointerEnter(PointerEventData eventData) { GameObject inventoryCanvas = GameObject.Find("Inventory Canvas"); tooltip.transform.SetParent(inventoryCanvas.transform); tooltip.Activate(item); }
public void OnPointerEnter(PointerEventData eventData) { tooltip.Activate(item); if (Input.GetKeyDown(KeyCode.F)) { } }
public void OnPointerDown(PointerEventData eventData) { if (item != null) { offset = eventData.position - new Vector2(this.transform.position.x, this.transform.position.y); tooltip.Activate(item); } }
public void OnPointerEnter(PointerEventData eventData) { if (ItemIns == null) { return; } _tooltip.Activate(ItemIns); }
public void OnMouseOver() { tooltip = GameObject.Find("ItemDatabase").GetComponent <Tooltip>(); if (townHallLevel == 0 && Time.timeScale > 0.0f) { tooltip.Activate("Looks like something was built here.\nClick to build!\nCost: " + buildCost); } }
public void OnMouseOver() { tooltip = GameObject.Find("ItemDatabase").GetComponent <Tooltip>(); if (Time.timeScale > 0.0f) { tooltip.Activate(ConstructDataString()); } }
public void OnPointerEnter(PointerEventData eventData) { if (slot > 9) // Disables tooltip for items in the hotbar(TODO) { tooltip.Activate(item); } this.transform.localScale = new Vector3(1.2f, 1.2f, 1); }
public void OnPointerEnter(PointerEventData eventData) { if (TargetResearch == null) { return; } _tooltip.Activate(TargetResearch); }
public void OnPointerEnter(PointerEventData eventData) { Item item = FetchItem(); if (item != null) { tooltip.Activate(item); } }
public void OnPointerEnter(PointerEventData eventData) { // If the item is in a hot-key slot, don't bother with the tool-tip if (HotKeySlot != -1) { return; } _tooltip.Activate(Item); }
public void OnPointerDown(PointerEventData eventData) { //We place the tooltip right where the player places their finger. offset = eventData.position - new Vector2(this.transform.position.x, this.transform.position.y); currPos = Input.mousePosition; tooltip.Activate(item); if (GameObject.Find("EquipmentHandler").GetComponent <EquipmentHandler>().Equipping) { GameObject.Find("EquipmentHandler").GetComponent <EquipmentHandler>().SelectorSlot = slot; } }
private void HandleReflect() { _audioSource.PlayOneShot(ReflectClips[Random.Range(0, ReflectClips.Count)]); ReflectTooltip.Activate(_currentBattleAction.Value); _reflectValue = _currentBattleAction.Value; _currentBattleAction = null; _isPerforming = false; Battle.IsCompletingTurn = false; Battle.ChangeTurn(); }
private void HandleShield() { _audioSource.PlayOneShot(ShieldClips[Random.Range(0, ShieldClips.Count)]); ShieldTooltip.Activate(_currentBattleAction.Value); _shieldValue = _currentBattleAction.Value; _currentBattleAction = null; _isPerforming = false; Battle.IsCompletingTurn = false; Battle.ChangeTurn(); }
public void OnPointerEnter(PointerEventData pointerEventData) { if (tooltip != null) { tooltip.setObject(gameObject); tooltip.Activate(true); if (canvasRectTransform == null) { return; } Vector3[] worldCorners = new Vector3[4]; GetComponent <RectTransform>().GetWorldCorners(worldCorners); Vector2 localRectTransform; RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRectTransform, new Vector2((worldCorners[3].x + worldCorners[0].x) / 2.0f, worldCorners[0].y), pointerEventData.enterEventCamera, out localRectTransform); Vector2 newTooltipPos = new Vector2(localRectTransform.x, localRectTransform.y); if (localRectTransform.y - tooltipRectTransform.sizeDelta.y < -canvasRectTransform.sizeDelta.y / 2) { newTooltipPos.y += tooltipRectTransform.sizeDelta.y + GetComponent <RectTransform>().sizeDelta.y; } if (localRectTransform.x - tooltipRectTransform.sizeDelta.x / 2 < -canvasRectTransform.sizeDelta.x / 2) { newTooltipPos.x = tooltipRectTransform.sizeDelta.x / 2 - canvasRectTransform.sizeDelta.x / 2; } if (localRectTransform.x + tooltipRectTransform.sizeDelta.x / 2 > canvasRectTransform.sizeDelta.x / 2) { newTooltipPos.x = canvasRectTransform.sizeDelta.x / 2 - tooltipRectTransform.sizeDelta.x / 2; } tooltipRectTransform.localPosition = newTooltipPos; } }
public void MouseEnter() { if (Global.inventoryManager.dragEnable) { Global.inventoryManager.endSlot = this; } if (currentitem == null) { return; } tooltip.Activate(currentitem); }
public void ShowDamageTooltip(int damage) { DamageTooltip.Activate(damage); }
public void OnPointerEnter(PointerEventData eventData) { Debug.Log("Pointer Enter"); tooltip.Activate(item); }
// player clicks item in inventory public void OnPointerDown(PointerEventData eventData) { // Android if (Application.platform == RuntimePlatform.Android) { if (item != null) { // first tap, show item's tooltip if (!tapped) { tapped = true; tooltip.Activate(item); } // 2nd tap else { tapped = false; // give medicine to NPC with second tap for (int i = 0; i < Input.touchCount; ++i) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began) { // iterate through the tapped item's medicines + dosages // and save them to arrays string[] titles = new string[item.medicine.Count]; float[] dosages = new float[item.medicine.Count]; int j = 0; foreach (Item it in item.medicine) { titles[j] = it.Title; dosages[j] = it.currentDosage; j++; } // pass the saved arrays to UIManager // try giving item to NPC first, then try trashing it // both return true if they succeed -> remove item from inventory if (uiManager.giveMed(titles, dosages)) { inv.RemoveItem(item.ID); tooltip.Deactivate(); break; } else if (uiManager.trashItem()) { inv.RemoveItem(item.ID); tooltip.Deactivate(); break; } } } } } } // same for PC, but without the mobile tapping stuff else { if (item != null) { string[] titles = new string[item.medicine.Count]; float[] dosages = new float[item.medicine.Count]; int j = 0; foreach (Item it in item.medicine) { titles[j] = it.Title; dosages[j] = it.currentDosage; j++; } if (uiManager.giveMed(titles, dosages)) { inv.RemoveItem(item.ID); tooltip.Deactivate(); } else if (uiManager.trashItem()) { inv.RemoveItem(item.ID); tooltip.Deactivate(); } else { // show tooltip above mouse cursor's position offset = eventData.position - new Vector2(this.transform.position.x, this.transform.position.y); this.transform.position = eventData.position - offset; } } } }
public void OnPointerEnter(PointerEventData eventData) { CardScaling.UpscaleCard(this); tooltip.ConstructTooltip(CurrentCard, this.gameObject); tooltip.Activate(); }
/*-------------------------------------------------------------------------------------- * -- FUNCTION: OnMouseEnter * -- DATE: 15/03/2016 * -- REVISIONS: * -- DESIGNER: Joseph Tam-Huang * -- PROGRAMMER: Joseph Tam-Huang * -- INTERFACE: public void OnMouseEnter() * -- RETURNS: void * -- NOTES: * -- Enable the tooltip when the mouse pointer hovers over the world item. * -----------------------------------------------------------------------------------------*/ public void OnMouseEnter() { _tooltip.Activate(item, amount); }
/*------------------------------------------------------------------------------------------------- * -- FUNCTION: OnPointerEnter * -- DATE: 17/02/2016 * -- REVISIONS: * -- DESIGNER: Joseph Tam-Huang * -- PROGRAMMER: Joseph Tam-Huang * -- INTERFACE: public void OnPointerEnter(PointerEventData eventData) * -- PointerEventData eventData: The event payload associated with pointer events. * -- RETURNS: void * -- NOTES: * -- Activates the tooltip when the mouse pointer enters the collider box of the item. * -------------------------------------------------------------------------------------------------*/ public void OnPointerEnter(PointerEventData eventData) { _tooltip.Activate(item); }
private void OnCanInteract() { Tooltip.Activate(isOpen ? "Close" : "Open", transform, Vector3.zero); }
private void OnCanInteract() { Tooltip.Activate(friendlyName, transform, transform.up * tooltipOffset); }
public void OnPointerEnter(PointerEventData eventData) { //this is for tooltip, when cursor enter the raycast of an item, the tooltip will appear tooltip.Activate(item); }
public void OnPointerEnter(PointerEventData eventData) { tooltip.Activate(ConstructDataString()); }
public void OnPointerEnter(PointerEventData eventData) { tooltip.Activate(this.GetComponent <ItemData>()); }