목록2023/08/11 (2)
아카이브

프리팹 생성 시 바로 부모를 설정하는 경우와 프리팹 인스턴스를 생성한 뒤에 부모를 설정하는 경우의 차이 Test_EquipItemMain.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Test_EquipItemMain : MonoBehaviour { [SerializeField] private Button btnRemoveSword; [SerializeField] private Button btnRemoveSword0; [SerializeField] private Button btnRemoveSword1; [SerializeField] priv..

히어로 좌클릭 생성 우클릭 삭제 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Test_CreateItem : MonoBehaviour { [SerializeField] private GameObject prefab; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { //좌클릭하면 히어로 생성되게 한다 if(Input.GetMouseButtonDown(0)) { //ray 만들기 Ray ray = Camera.main.ScreenP..