상세 컨텐츠

본문 제목

[C#] timeText

유니티

by simstealer 2022. 7. 11. 14:03

본문

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// 게임 재시작 및 UI 관리
using UnityEngine.UI; // UI 관련한 라이브러리
using UnityEngine.SceneManagement; // 씬 관련한 라이브러리

public class GameManeger : MonoBehaviour
{
    public Text timeText;
	private string s1;
    
    void Start()
    {
    	s1 = "안녕!"
    }
    
    void Update()
    {
    	// 텍스트 변경
        timeText.text = "time : " + s1;
        // 텍스트 크기 변경
        timeText.fontSize = 30;
        // 텍스트 색깔 변경
        timeText.color = Color.blue;
        // 텍스트 스타일 변경
        timeText.fontStyle = FontStyle.Italic;
    }
}

'유니티' 카테고리의 다른 글

[C#] PlayerPrefs  (0) 2022.07.11
[Unity] Scene 전환  (0) 2022.07.11
[C#] Instantiate()  (0) 2022.07.11
[C#] FindObjectOfType()  (0) 2022.07.11
[C#] 랜덤 값  (0) 2022.07.11

관련글 더보기

댓글 영역