영어 공부/기타

유니티 튜토리얼 한글 번역 - C# Scripts as Behaviour Components in Unity! - Beginner Scripting Tutorial (2/2)

manwon 2019. 10. 16. 22:04
반응형

 

C# Scripts as Behaviour Components in Unity! - Beginner Scripting Tutorial [유니티 런 링크]

[알림] 유니티 튜토리얼 동영상을 한글로 번역하며 공부 중입니다. 가급적 뜻을 쉽게 파악할 수 있도록 의역을 한 곳이 많습니다. 잘못된 해석은 댓글로 알려주세요. 

 

 

[오늘 번역은 영상 54초부터 시작합니다]

We then drill down to the value that we want and effect it.
그런 다음 우리가 원하는 값에 접근해 들어갈 수 있고 또한 그 값을 변경할 수도 있습니다. 

 

Here, we're addressing the game object this script's attached to, we're then addressing the renderer, which is the component seen here, Mesh Renderer, we're then addressing the material attached to that renderer, and finally the color of that material.
여기에서(이 스크립트에서)  우리는 이 스크립트가 부착된 게임오브젝트에 접근할 수 있고, 그리고 나서 렌더러에 접근할 수 있습니다. 지금 여기 보이는 렌더러 그래요 이 메시렌더러 말입니다. 그런 후에 우리는 저 렌더러에 부착된 메터리얼에 접근할 수 있어요. 그리고 마지막으로 이 메터리얼의 색상에도 접근할 수 있게 되는 거죠 .

 

And we're setting it to a shortcut called Red, which is part of the color class.
그리고 나서 이 메터리얼의 색상값에 빨간색 숏컷 값을 대입할 거에요. 이 빨간색 숏컷 값은 칼라 클래스에 들어있는 값이죠.
[나의 추측] 처음에 잘 해석이 안 되었는데, 나는 다음과 같은 방식으로 이해했다. 'set A to B'라는 건 'A를 B로 설정했다'인 것 같은데, 여기서 it이 무엇일까 생각을 해 봤다. 아마도 여기서 it은 예제의 스크립트 코드 GetComponet<Renderer>().material.color=Color.red 중에서 color 값을 얘기하는 것 같다. 즉 이 color값에 Color.red값을 대입하게 되는데, Color.red를 a shortcut called Red라고 표현한 것 같다. 복잡한 rgb값이 아니라 단순히 red라고 표현하고 있기 때문에 shortcut이란 표현을 한 거 같다. 또한 Color.red니까 Color클래스에 포함된 red라고 본 것이고 이것을 영어로 part of the color class라고 기술한 것 같다. 아마도 이게 맞는 듯. 

 

Let's see this in action.
실제로 실행을 하면서 한 번 살펴봅시다.

 

If I press play, then use the R, G, or B keys on the keyboard, I can change the color.
만약 플레이 버튼을 눌렀고 R, G 또는 B키를 눌렀다면 그에 맞는 색상으로 변할 거야 . 

 

And you can see that the material is being effected.
이제 메터리얼이 변하는 것을 볼 수 있습니다.

 

So this material is applied to the renderer, Default Diffuse, you can see that listed there.
그러니까 저기 나열된 채 보이는 디폴트 디퓨즈로 명명된 메터리얼은 렌더러에 적용이 되는 거죠.

 

And we're then effecting the main color value and setting it to a certain value in here, the same as it would if I was actually doing it by hand in the editor.
이제 우리는 여기에서(여기를 클릭해서) 메인 칼라값을 변경할 수도 있고 아니면 다른 어떤 값으로 설정할 수도 있습니다. 이건 마치 아까 내가 에디터에서 손으로 R,G,B를 누르며 색을 변경했던 것과 결과적으로 같다고 보시면 됩니다.
[나의 추측] the same as it would if 부분의 뜻을 사전을 찾아도 파악하지 못했다. 그래서 그냥 ~했던 것과 같다로 추측해서 해석했다. 또한 doing it by hand in the editor도 뜻 파악이 좀 애매했다. 저 에디터를 c#코드를 타이핑하는 비주얼 스튜디오 2017 에디터로 봐야할지, 유니티 에니터로 봐야할지 잘 모르겠다. 만약 전자로 본다면 'c#으로 색상을 변하게 하는 코딩과' 같다고 해석해야 할 것이고 후자로 본다면 '유니티 에디터에서 플레이 버튼을 눌러 프로젝트를 실행한 후 손으로 R,G,B 키를 누르는 것과 같다'고 해석해야 할 것이다. 나는 후자로 찍었다. 

 

Scripts can be created in the project panel by choosing Create. For example. 
스크립트는 프로젝트 패널에서 크리에이트 버튼을 클릭하면 생성할 수 있습니다. 예를 들어서요. 

 

They can then be attached to objects, either by dragging and dropping, or by choosing the Add Component button at the bottom of the component menu, and then choosing from the list of scripts in your current project.
스크립트는 오브젝트에 첨부될 수 있는데, 드래그 드랍 방식으로 첨부해도 되고 아니면 컴포넌트 메뉴의 맨 밑에 있는 컴포넌트 추가하기 버튼을 클릭한 후, 현재의 프로젝트에 있는 스크립트 리스트 중에서 하나의 스크립트를 선택해도 됩니다. 

 

Scripts can also be created using the Add Component button by choosing New Script from the bottom and naming the script from the drop-down.
Add Component 버튼을 누른 후 나오는 드랍다운 항목들 중에서, New Script를 선택하는 방법으로도 스크립트를 생성할 수 있습니다.

 

This can then be created and added in one step.
이런 방법을 쓰면 생성과 등록이 원스텝으로 해결됩니다.

 

 The final way to add a script to your object is to select the object in the hierarchy and then choose Components, Scripts, and then choose from the list of scripts in your current project.
오브젝트에 스크립트를 추가하는 마지막 방법은 Hierarchy에 있는 오브젝트를 선택한 후 메뉴에서 Components->Scripts 순으로 선택한 후 현재 프로젝트에서 쓰이는 스크립트 들의 목록 중에서 하나를 선택하는 것입니다.

 

Of course you can apply scripts to do all manner of other behaviors of objects.
물론 당신은 오브젝트들이 온갖 종류의 작동을 수행하도록 하는 스크립트를 작성할 수도 있습니다.

 

Try to think of scripts as components that you create yourself, allowing you to create behavior for different game objects in your game.
스크립트를 자신이 직접 만드는 컴포넌트라고 생각하세요. 당신의 게임 속 다양한 게임오브젝트들의 작동을 당신이 창조할 수 있도록 도와주는 그런 컴포넌트 말이에요. 

 

This could be characters, it could be environments, or it could be scripts that manage the functionality of the game.
이건 게임 캐릭터가 될 수도 있고, 게임환경이 될 수도 있고 혹은 게임의 어떠한 기능을 관리하는 스크립트가 될 수도 있어요.
※ 여기서 This가 의미하는 게 무엇인지 잘 모르겠다. 전반적인 해석도 제대로 되었는지 모르겠다.

  

반응형