Untitled

 avatar
unknown
plain_text
a month ago
1.5 kB
2
Indexable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEditor.VersionControl;

public class Text_UI_Handler : MonoBehaviour {
    public GameObject MonsterTEXT;
    public GameObject MonsterNumTEXT;
    public GameObject StartTEXT;
    public TextMeshProUGUI textMeshPro;
    public float faceSoftness = 1.0f;



    public void Start() {
        MonsterTEXT = GameObject.Find("MonsterDistance_Text");
        MonsterNumTEXT = GameObject.Find("MonsterDistanceNumber_Text");
        StartTEXT = GameObject.Find("PressToStart_Text");
        Material textMaterial = textMeshPro.fontMaterial;

        // Material textMaterial = textMeshPro.fontMaterial;
        // textMaterial.SetFloat("FaceSoftness", faceSoftness);

    }

    private void Update() {


        textMeshPro.fontMaterial.SetFloat("FaceSoftness", faceSoftness);
        Debug.Log(faceSoftness);

        if (GameHandler.Instance.isGameWaitingToStart()) {

            MonsterTEXT.gameObject.SetActive(false);
            MonsterNumTEXT.gameObject.SetActive(false);
            StartTEXT.gameObject.SetActive(true);

        }
        if (!GameHandler.Instance.isGameWaitingToStart()) {
            MonsterTEXT.gameObject.SetActive(true);
            MonsterNumTEXT.gameObject.SetActive(true);
            StartTextBreak();
        }
    }

    void StartTextBreak() {

        StartTEXT.gameObject.SetActive(false);
    }
}
Editor is loading...
Leave a Comment