-
using System.Collections; using System.Collections.Generic; using UnityEngine; public class FadeColor : MonoBehaviour { SpriteRenderer sr; public GameObject go; void Start() { sr = go.GetComponent<SpriteRenderer>(); } void Update() { if (Input.GetKeyDown("i")) //sr.material.color = new Color(0.3f, .04f, 0.7f); sr.material.color = new Color(0.6f, 0.4f, 0.0f); } }
'프로그래밍 > Unity' 카테고리의 다른 글
[C#] GameObject[]에 Text할당하기 (0) 2022.05.18 [C#] 시간 지연(delay) 주기 (0) 2022.03.14 [C#] 타이머 제작 (0) 2022.02.28 [2D] 타일을 찍어봅시다 (0) 2022.02.20 [협업] Export 방법 (0) 2021.11.15 댓글