251113 스크립터블 오브젝트
·
📖TIL
직렬화와 스크립터블 오브젝트 스크립터블 오브젝트는 유니티 에셋으로 데이터를 저장시키고 필요할 때 꺼내서 쓰는 기능이다.데이터와 코드를 분리하기 위한 유용한 기능이다.using UnityEngine;using UnityEngine.InputSystem;public class CubeSpawner : MonoBehaviour{ public GameObject cubePrefab; // 하나의 프리팹만 사용 void Update() { if (Keyboard.current.qKey.IsPressed()) { GameObject newCube = Instantiate(cubePrefab, Vector3.zero, Quaternion.identity);..