저번 주에 제가 PNG 컨셉 증명을 한주 동안 하고, 시간이 남으면 화면 클릭 좌표 감지 코드도 짠다고 했죠.
그런데 화면 클릭 좌표 코드는 그 날(저번 일요일) 저녁에 바로 됬습니다.
이건 사실 시행착오가 엄청나게 많이 필요한 거라, 한 번에 딱 끝내는 게 나은 작업이었지만요.
그리고 PNG 테스트는 월-화요일에 다 됬고요.
256*256 파일을 생성, 저장.
그리고 불러오면서 데이터에 오점이 없는지 확인.
물론 이걸 할 때는 완전 랜덤으로 갔어야했지만...
그래서 내부적으로 코드를 계속 뜯어고쳐서, 에디터를 위해 층 하나/벽 하나씩만 제작할 수 있게 했습니다.
꺽은 선 형태의 벽을 그리는 코드만 짠 뒤에 저장 실험을 했습니다.
새로운 벽을 그릴 때, 전 프레임의 벽을 지우는 코드를 넣지 않음.
그리고 카메라 높이에 따라 단면이 움직이게 함.
작동합니다.
또 벽 위치, 아니 모든 위치에 상대 좌표도 사용할 수 있게 할 겁니다. (e.g. 블록 왼쪽 앞부분 모서리부터 좌로 몇 미터, 뒤로 몇 미터)
그리고 블록 모양도 다양하게 만들 수 있게 해야겠죠.
사각형, 오목한 호, 볼록한 호, 원형.
에디터 UI를 추가하죠.
PNG Format Testing, Drawing Walls w/i Runtime
Last week, I said I'll prove the PNG format concept, and if the time left, write a script detecting where I clicked.
However, I finished the detecting one that day(last Sunday)'s evening.
Since this needs lots of trial and error, this should've done in a one time.
And PNG testing were done in Tuesday.

For testing, I generated 256*256 images, and saved them.

And I loaded them while checking corruptions.
Of course this should've done with complete random images, but it's a bit time consuming.
By the way, unlike Flash, Unity doesn't require user's input to load/save files, which is good.
As I got time, I edited codes for the editor which will need to generate one floor(level)/wall at a time.
After that, I made the way to convert blockdata to PNG, (reversing the process-loading wasn't finished this week)
and I tested saving block right after making drawing multi-line walls possible.

I forgot to add the code removing last frame's wall gameObject.


01
And I made sections move along the height of camera.


01
In next week, I will make drawing other kinds of wall possible,
and giving ability to cord of walls, or, cord of everything of using relative cord.
(e.g. n meters left, n meters back from Block's left-front corner)