Updated a lot of text to tmp and updated title

This commit is contained in:
Melbyj1125
2022-04-19 23:53:18 -05:00
parent 5900708638
commit 7791d79d18
19 changed files with 4511 additions and 827 deletions

View File

@@ -2,13 +2,14 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class KingTooltips : MonoBehaviour
{
////Weather Wheel Variables
public Text curWeatherText;
public Text curWeatherTitle;
public TextMeshProUGUI curWeatherText;
public TextMeshProUGUI curWeatherTitle;
string rainExplanation = "Increases the players acceleration & decreases the players traction.";
string rainTitle = "Rain";
@@ -24,13 +25,13 @@ public class KingTooltips : MonoBehaviour
////Placeables Variables
public GameObject curPlaceablesSpriteObj;
public Text curPlaceablesText;
public TextMeshProUGUI curPlaceablesText;
public Image curPlaceablesImage;
string blockExplanation = "Place a block on the grid to obstruct a players movement.";
string bumperExplanation = "Places a bumper on the grid to obstruct and knock the players back.";
string slimeExplanation = "Click and hold the mouse to place and then choose the direction the slowing slime goes.";
string hailExplanation = "Click and hold the mouse to adjust the hail size dropping papers";
string hailExplanation = "Click and hold the mouse to adjust the hail size dropping paper balls.";
string defaultPlaceablesExplanation;
public Sprite block;

View File

@@ -4,6 +4,8 @@ using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
using TMPro;
public class LobbyItems : MonoBehaviour
{
@@ -13,7 +15,7 @@ public class LobbyItems : MonoBehaviour
PlayerInventory pInv;
public GameObject itemOptPrefab;
public GameObject costPointer;
public Text costPointerText;
public GameObject costPointerText;
public Vector3[] costPointerPos;
private Slider glueGooSlider;
@@ -110,11 +112,11 @@ public class LobbyItems : MonoBehaviour
//Changes Button Texts
iOpt.GetComponent<Image>().sprite = itemBG[index];
iOpt.transform.Find("Name").GetComponent<Text>().text = item.Value.itemName;
iOpt.transform.Find("Name").GetComponent<TextMeshProUGUI>().text = item.Value.itemName;
iOpt.transform.Find("Name").localPosition = itemNamePos[index];
iOpt.transform.Find("Name").localEulerAngles = itemNameRot[index];
iOpt.transform.Find("Cost").GetComponent<Text>().text = item.Value.costM.ToString();
iOpt.transform.Find("Cost").GetComponent<TextMeshProUGUI>().text = item.Value.costM.ToString();
iOpt.transform.Find("Cost").localPosition = itemCostPos[index];
iOpt.transform.Find("Cost").localEulerAngles = itemCostRot[index];
@@ -139,7 +141,7 @@ public class LobbyItems : MonoBehaviour
//Player can remove the item
pointsLeft += itemCost;
costPointer.transform.localPosition = costPointerPos[pointsLeft];
costPointerText.text = pointsLeft.ToString();
costPointerText.GetComponent<TextMeshProUGUI>().text = pointsLeft.ToString();
//Glue level
glueGooSlider.value += itemCost;
@@ -154,7 +156,7 @@ public class LobbyItems : MonoBehaviour
//Player can add the item
pointsLeft -= itemCost;
costPointer.transform.localPosition = costPointerPos[pointsLeft];
costPointerText.text = pointsLeft.ToString();
costPointerText.GetComponent<TextMeshProUGUI>().text = pointsLeft.ToString();
//glue level
glueGooSlider.value -= itemCost;

View File

@@ -2,14 +2,15 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class Tooltip : MonoBehaviour
{
private Text tooltipText;
private TextMeshProUGUI tooltipText;
private void Start(){
tooltipText = transform.Find("Text").GetComponent<Text>();
tooltipText = transform.Find("Text").GetComponent<TextMeshProUGUI>();
HideTooltip();
}

View File

@@ -14,9 +14,13 @@ public class ConnectButtons : MonoBehaviour {
public GameObject ErrorPanel;
public Text ErrorText;
public GameObject ipAddressObject;
public InputField ipAddressField;
public TMP_InputField playerNameField;
public GameObject hostButton;
public GameObject joinButton;
private int connectionTimeoutTime = 5;
void Start() {
@@ -79,6 +83,19 @@ public class ConnectButtons : MonoBehaviour {
StartCoroutine(checkIsConnectedClient());
}
public void ToggleIPAddress(){
if(ipAddressObject.active){
ipAddressObject.SetActive(false);
hostButton.SetActive(true);
joinButton.SetActive(true);
}
else{
ipAddressObject.SetActive(true);
hostButton.SetActive(false);
joinButton.SetActive(false);
}
}
IEnumerator checkIsConnectedClient() {
yield return new WaitForSecondsRealtime(connectionTimeoutTime);