private void Awake() { if (tileItem != null) { GameObject initialItem = Instantiate(tileItem.gameObject, transform.position, transform.rotation, transform); TileItem initialTileItem = initialItem.GetComponent <TileItem>(); tileItem = initialTileItem; tileItem.SetTileSlot(this); } else { throw new System.Exception("Item slot is missing item on Awake."); } }
private void SetNewItem(TileItem newItem) { tileItem = newItem; tileItem.SetTileSlot(this); }