Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
using System.Collections.Generic;
public class TooltipHover : UIBehaviour, IPointerEnterHandler, IPointerExitHandler {
public Container container;
public GameObject TT;
public GameObject TTStats;
public GameObject TTName;
public GameObject TTValue;
public GameObject TTType;
void Awake(){
container = gameObject.GetComponent<Container>();
//TT = GameObject.Find ("TooltipPanel");
TTStats = GameObject.Find ("TTStats");
TTName = GameObject.Find ("TTName");
TTValue = GameObject.Find ("TTValue");
TTType = GameObject.Find ("TTType");
// Use this for initialization
void Start () {
TT = GameObject.Find ("TooltipPanel");
void Update(){
public virtual void OnPointerEnter(PointerEventData eventData){
TTName.GetComponent<Text>().text = container.item.itemName;
TTValue.GetComponent<Text>().text = ""+container.item.value;
switch (container.item.type){
case 0:
TTType.GetComponent<Text>().text = "Thing";
TTStats.GetComponent<Text>().text = container.item.statText;
public virtual void OnPointerExit(PointerEventData eventData){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.