Unity3d Game Development Trader Module development experience

Source: Internet
Author: User

Figure 0

Well, gossip doesn't say much, let's get started ~

Figure 1

here is still to name the surname of the kimchi children's shoes, this part of the preset in Figure 1 is when I first took over, the structure is as follows:
Ui_shop: The parent object of the entire store
SHOP_BG: Store's brown floor background
SHOP_TITLE_BG: Banner store two words, including the banner itself
Shop_head: Hina shop Sister head
Shop_refresh_button: Refresh button
BACKBT: Back button
shop_product_bg_00: Product code XX
shop_product_bg_01: Ibid .
shop_product_bg_02: Ibid .
shop_product_bg_03: Ibid .
shop_product_bg_04: Ibid .
shop_product_bg_05: Ibid .

Yes, no, we'll analyze what art materials are needed in the store.
product art materials include:
quality frame (e.g.,)
symbol icons (such as,,,) "slightly larger workload "

sort Small icons (such as,)
Cost icon (such as,)

The light collects these material expense the friend son Dickens Ah, pure man son ~ This is just the first step,
Next, when the footage is sufficient, we start to build the presets.

Yes, if Declan old wet not guessed wrong, must have careful little bull will find:
the icon of the item is basically the ———— of such a child >, is four-sided.
and the quality frame like "fragment" or "Soul Stone" is similar to Jiangzi ———— >, a pair of corners are cropped.




"What if the two graphs overlap, beyond the outer frame?" "such as
"What if I just scaled down the scale of the item icon, even if it didn't go out of the box, but the whole UI looked hollow?" "such as

If the audience in front of the TV ... Uh, no. It is the same problem that the novice readers before the display, do not worry or fear, it is just because we are novice because of inexperienced and inexperience, lack of mask mask concept.



Figure 2





So what does the so-called mask, in unity, accomplish?


Figure 3
you need to create a material ball and select the shader as the shader script we wrote, then drag the Hero icon to the base item, and drag the fragment mask icon with the alpha channel onto the culling mask. The code is as follows:
  1. Shader "Custom/depthmaskshader" {
  2. Properties
  3. {
  4. _maintex ("Base (RGB)", 2D) = "White" {}
  5. _mask ("Culling Mask", 2D) = "White" {}
  6. _cutoff ("Alpha Cutoff", Range (0,1)) = 0.1
  7. }
  8. Subshader
  9. {
  10. Tags {"Queue" = "Transparent"}
  11. Lighting OFF
  12. Zwrite OFF
  13. Blend Srcalpha Oneminussrcalpha
  14. Alphatest gequal [_cutoff]

  15. Pass
  16. {
  17. SetTexture [_mask] {combine texture}
  18. SetTexture [_maintex] {combine texture, previous}
  19. }
  20. }
  21. }
Copy Code
display effect as shown in 4



Ok,shader is not the focus of this article, but after a brief explanation, we start to get to the point. Article origin "Dog planing learning Net"
In fact, Unity's new UI system--ugui has done a similar component for us, 5
Figure 5
Usage: Add this component directly to the icon with an alpha channel where you need to implement the mask.
Then, after knowing the concept of masking and the use of the mask component, we look at the hierarchical structure of individual product presets more clearly. 6

Figure 6
As shown, the default hierarchy relationship is: SHOP_PRODUCT_BG: is a single product preset, parent object. Goods: is a specific item preset parent object full: is a complete article like a short stick, a potion of experience chip: a piece of debris such as a flute reel or a non-complete object of a soul stone Chip_ Mask: In addition to the image component added the Mask component Cardicon: is the specific item icon kind: is a fragment (yellow) or Soul stone (purple) icon count: is the specific number of this article Title: the Product name cost: The specific value of the purchase of the product Image: for cost type (e.g. gold, crystal, etc.) Soldoutimage: The sold-out icon that will be displayed when the purchase is complete

Unity3d Game Development Trader Module development experience

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.