Ebook Learn unity for 2D game development: Part 2
➤ Gửi thông báo lỗi ⚠️ Báo cáo tài liệu vi phạmNội dung chi tiết: Ebook Learn unity for 2D game development: Part 2
Ebook Learn unity for 2D game development: Part 2
UVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel to Ebook Learn unity for 2D game development: Part 2 a larger atlas texture. Atlas Textures help US improve the performance of our 2D games. In generating the atlas, we also saved meta-data. This included all filenames of textures inside the atlas, and their uv positions within the atlas. In closing that chapter, we tested the add-on functionality by Ebook Learn unity for 2D game development: Part 2 assigning an Atlas Texture to a procedural Quad Mesh in the scene, to see how it looked in the Viewport. The problem we faced was that the quad meshEbook Learn unity for 2D game development: Part 2
rendered the complete atlas texture, rather than just a region of it (see Figure 7-1). The problem was not with the Atlas Texture, but with the mesh iUVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel to Ebook Learn unity for 2D game development: Part 2 must be adjusted at the vertex level. That is. we must dig deeper into the mesh construction and edit its vertices. We’ll do that in this chapter, as we create a new editor add-in to control mesh uv mapping. This add-on lets us select a textured quad in the scene and entirely customize its uv mappi Ebook Learn unity for 2D game development: Part 2ng to show any region within the Atlas Texture (or within any texture!). In addition, we’ll also create another class to change uv mapping over time,Ebook Learn unity for 2D game development: Part 2
creating a flipbook animation effect or an animated sprite effect.139140 CHAPTER 7: UVs and AnimationFigure 7-1. By default textured quads are generatUVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel to Ebook Learn unity for 2D game development: Part 2 fix this, well need to edit the mesh uv mappingCreating a Dockable EditorSo far in this book we've built three editor add-ons (if you've been following every chapter): a Batch Rename tool, a Create Quad tool, and a Create Atlas Texture tool. Despite the enormous differences in behavior between thes Ebook Learn unity for 2D game development: Part 2e tools, they still have an important characteristic in common relating to their usability and design. Specifically, a developer uses them all to runEbook Learn unity for 2D game development: Part 2
one-hit operations; that is, a “one click and you're done" paradigm. For example, to rename multiple objects, just select the objects in the scene andUVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel to Ebook Learn unity for 2D game development: Part 2 well so far. But, the task that faces US now (editing mesh UVs) is different in this regard. Our scene may have potentially many different Quad Mesh objects that must be edited (not just one or two), and we’ll want to perform those edits quickly and intuitively from the editor, without having to vi Ebook Learn unity for 2D game development: Part 2sit the application menu, launching different Scriptablewizard windows one after the other. Instead, it would be great if we could have a non-modal anEbook Learn unity for 2D game development: Part 2
d dockable window, such as the Object Inspector, showing all relevant uv properties we can edit and have applied to the selected object (see Figure 7-UVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel to Ebook Learn unity for 2D game development: Part 2ionV a.X 0f Potation1z -10X 0Y Scale0z 0XIYanz 1’ VCamera■ o.Clear FlagstBackground/Culling Mask b' fverythinq?«ProjectionPerspectiveIField of View Clipping PlanesEbook Learn unity for 2D game development: Part 2
cked in the interface. It offers intuitive property editing featuresSo let’s create an Editorwindow class for the uv editing feature. To do this, follUVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel to Ebook Learn unity for 2D game development: Part 2iptablewizard works fine for pop-up dialogs launched from the menu, but for more integrated behavior we need Editorwindow. Take a look at Listing 7-1 for our class skeleton. Figure 7-3 shows the project at this stage, configured and ready for coding.Listing 7-1. UVEdlt.cs Ebook Learn unity for 2D game development: Part 2UVs and AnimationThe previous chapter explained how to develop a GUI editor add-in that allows users to add selected textures in the project panel toGọi ngay
Chat zalo
Facebook