유니티 기초 40

몬스터를 죽이면 리스트에서 없애고 임의 위치에 포탈생성

https://dpdwm.tistory.com/19 [랜덤] using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Test3 { //씬의 모든 객체들을 관리 public class Test_CreatePortalMain : MonoBehaviour { [SerializeField] private MonsterGenerator monsterGenerator; [SerializeField] private GameObject portal; private List monsterList; // Start is called before the first frame update void Start() { //컬렉..

유니티 기초 2023.08.10

SimpleRPG

1. 방법 - Unity에서 만들기 변수에 메서드 설정한 거 .. On Click --> 대리자 100% 2. 방법 - 코드 익명 - 람다 이벤트 지우기 익명을 선호하는게 좋다고함.. 명명을 사용하는 경우는 내부 구현이 길어질 때 [TestAttack] 사용한다고 함 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Test2 { public class Test_PlayerAttackSceneMain : MonoBehaviour { [SerializeField] private Button btnAttack; [SerializeField] private Her..

유니티 기초 2023.08.09

코루틴

https://docs.unity3d.com/kr/2021.3/Manual/Coroutines.html 코루틴 - Unity 매뉴얼 코루틴을 사용하면 작업을 다수의 프레임에 분산할 수 있습니다. Unity에서 코루틴은 실행을 일시 정지하고 제어를 Unity에 반환하지만 중단한 부분에서 다음 프레임을 계속할 수 있는 메서드입니 docs.unity3d.com using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Test { public class HeroController : MonoBehaviour { // Start is called before the first frame update void St..

유니티 기초 2023.08.08