Created
December 10, 2014 01:41
-
-
Save josephjaniga/776191416b60267dd81c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
//TT.SetActive(false); | |
} | |
void Update(){ | |
} | |
public virtual void OnPointerEnter(PointerEventData eventData){ | |
//TT.SetActive(true); | |
TTName.GetComponent<Text>().text = container.item.itemName; | |
TTValue.GetComponent<Text>().text = ""+container.item.value; | |
switch (container.item.type){ | |
case 0: | |
default: | |
TTType.GetComponent<Text>().text = "Thing"; | |
break; | |
} | |
TTStats.GetComponent<Text>().text = container.item.statText; | |
} | |
public virtual void OnPointerExit(PointerEventData eventData){ | |
//TT.SetActive(false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment