Added tooltips to characterinformation, v1.0.1

This commit is contained in:
Nicola Sovic
2022-02-24 13:57:44 +01:00
parent 61b81da607
commit 82640ba473
5 changed files with 398 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ namespace Assets.Scripts
public class PlayerCamera : MonoBehaviour
{
UIHandler uihandler;
// Start is called before the first frame update
void Start()
{

View File

@@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace Assets.Scripts
{
public class TooltipHandler : MonoBehaviour
{
public GameObject tooltip;
Player player;
UIHandler uihandler;
// Start is called before the first frame update
void Start()
{
player = GameObject.Find("Player").GetComponent<Player>();
uihandler = GameObject.Find("UIHandler").GetComponent<UIHandler>();
}
// Update is called once per frame
void Update()
{
}
public void showTooltip(string text)
{
tooltip.transform.Find("txtTooltip").GetComponent<Text>().text = text;
tooltip.transform.localScale = new Vector3(1,1,1);
}
public void hideToolTip()
{
tooltip.transform.localScale = new Vector3(0,0,0);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ff63195da43e3a145abba1304336b467
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -24,6 +24,7 @@ namespace Assets.Scripts
public GameObject playerHUD;
public GameObject questlog;
public GameObject tutorial;
public GameObject tooltip;
public UIState state;