본문 바로가기
728x90

목록244

콜라보이벤트) 라스트오리진 x 우로부치 겐 22년 5월 30일부터 7월 11일까지 진행되는 라스트오리진 x 우로부치 겐 콜라보 이벤트!!! 게임은 구글 플레이스토어, 원스토어, 애플 앱스토어에서 다운 가능 공식카페 : https://cafe.naver.com/lastorigin 2022. 6. 6.
Unity & C# ~ 텍스트 사이즈에 맞춰서 width값 설정하기 using UnityEngine; using TMPro; public class Test : MonoBehaviour { public TMP_Text tmpText; private void Awake() { tmpText.GetComponent().sizeDelta = new Vector2(tmpText.preferredWidth, tmpText.preferredHeight); } } - content size filter를 사용하지 못할 때 코드로 사이즈 조정을 해줄 수 있다. 2022. 6. 3.
Unity & C# ~ 코루틴으로 회전하기 (Rotate Coroutine) Coroutine rotCoroutine = null; float rotSpeed = 30.0f; public void RotStartFunc() { rotCoroutine = StartCoroutine(CoroutineRotFunc()); } IEnumerator CoroutineRotFunc() { var angles = transform.rotation.eulerAngles; angles.z -= Time.deltaTime * rotSpeed; transform.rotation = Quaternion.Euler(angles); yield return null; rotCoroutine = StartCoroutine(CoroutineRotFunc()); } public void RotStopFunc().. 2022. 5. 31.
Unity & C# ~ Button Sprite Swap Scirpt Controller using System.Collections; using UnityEngine; using UnityEngine.UI; public class HUD_ButtonController : MonoBehaviour { [SerializeField] Sprite defaultSprite; [SerializeField] Sprite selectedSprite; [SerializeField] Sprite pressedSprite; [SerializeField] Sprite highlightSprite; Image thisImage; bool isPress = false; bool IsPress { get { return isPress; } set { isPress = value; } } private const f.. 2022. 5. 31.
Unity & C# ~ 리모트 버튼에서 스킵 버튼을 눌렀을 때 동작 Coroutine skipCoroutine = null; EventSystem = eventSystem; void Start() { eventSystem = GameObject.Find("EventSystem").GetComponent(); } void SkipFunc() { PlayBT.image.sprite = playSelectedImg; //플레이버튼 선택 이미지 PauseBT.image.sprite = pauseDefaultImg; //일시정지버튼 비활성화 이미지 if (skipCoroutine == null) { skipCoroutine = StartCoroutine("SkipCoroutineFunc"); } else if(skipCoroutine != null) { StopCoroutine(.. 2022. 5. 31.
Unity & C# ~ Singleton(싱글톤) //예제1 private static T _instance = null; public static T _Instance { get { if (_instance == null) { _instance = FindObjectOfType(typeof(T)) as T; } return _instance; } } //예제2 private static T _instance = null; public static T _Instance { get { if (_instance == null) { _instance = FindObjectOfType(typeof(T)) as T; if (_instance == null) { GameObject obj = new GameObject(); obj.name = "NAME"; _in.. 2022. 5. 20.
SMALL