Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UI_Tooltip : MonoBehaviour {
public GameObject mouseTarget;
public static string updateField;
Text updates;
//private MetalZombieTagScript metalZombieTagScript;
//private JazzZombieTagScript jazzZombieTagScript;
public GameObject jazzZombie;
public GameObject metalZombie;
// Awake----------------------------------------------------------
void Awake ()
{
//metalZombieTagScript = GetComponent<MetalZombieTagScript>();
//jazzZombieTagScript = mouseTarget.GetComponent<JazzZombieTagScript>();
updates = GetComponent<Text>();
}
//start =====================================================================
void Start()
{
updateField = "...";
}
// Update--------------------------------------------------------------
void Update ()
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
//if (Physics.Raycast(ray, out hit))
//{
// if (hit.collider.gameObject.name == "JazzZombie")
// {
// Debug.Log("Jazz, bitch!");
// }
//}
//if (Physics.Raycast(ray, out hit))
//{
// if (hit.collider.gameObject.name == "MetalZombie")
// {
// Debug.Log("Metal, mate!");
// }
//}
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.gameObject.GetComponent("JazzZombieTagScript") == true)
{
updateField = "I like Jazz!";
}
}
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.gameObject.GetComponent("MetalZombieTagScript") == true)
{
updateField = "I like Metal!";
}
}
//Text Updates-------------------------
updates.text = updateField;
}
}