public void StageSave() { Stage stageInfo = new Stage(); int objectCount = stage.transform.GetChildCount(); stageInfo.blocks = new Block[objectCount]; for (int i = 0; i < objectCount; i++) { Block blockInfo = new Block(); Transform block = stage.transform.GetChild(i); if (block.GetComponent <NotGameOVerObject>() != null) { // NotGameOverObject를 가지고 있으면 blockInfo.objectNumber = 0; } if (block.GetComponent <GameOverObject>() != null) { blockInfo.objectNumber = 1; } if (block.GetComponent <ColorChangeItem>() != null) { blockInfo.objectNumber = 2; } blockInfo.shape = block.tag; blockInfo.pX = block.position.x; blockInfo.pY = block.position.y; blockInfo.pZ = block.position.z; blockInfo.sX = block.localScale.x; blockInfo.sY = block.localScale.y; blockInfo.sZ = block.localScale.z; stageInfo.blocks[i] = blockInfo; } stageInfo.stageNumber = stageNum; var filePath = Application.dataPath + "/Resources/Stage/stage" + stageNum + ".bytes"; Debug.Log(filePath); BinaryData.BinarySerialize <Stage>(stageInfo, filePath); Debug.Log("SaveStage"); }