Better









How do I use Better
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PurposeLabel.cs Copy
16         void Start()
17         {
18             BitmapFont purposeFont1 = new BitmapFont("Fonts/shop_font", "Fonts/shop_font_xml", purposeLabel1);
19             BitmapFont purposeFont2 = new BitmapFont(purposeFont1, purposeLabel2);
20             BitmapFont purposeFont3 = new BitmapFont(purposeFont1, purposeLabel3);
21
22             purposeFont1.setText("5th place or better : 50 #", 0, 12, "GUI", "GUI");
23             purposeFont2.setText("3rd place or better : 100 #", 0, 12, "GUI", "GUI");
24             purposeFont3.setText("1st place : 200 #", 0, 12, "GUI", "GUI");
25
26             purposeLabel1.transform.localScale = new Vector3(0.8f, 0.8f, purposeLabel1.transform.localScale.z);
27             purposeLabel2.transform.localScale = new Vector3(0.8f, 0.8f, purposeLabel2.transform.localScale.z);
28             purposeLabel3.transform.localScale = new Vector3(0.8f, 0.8f, purposeLabel3.transform.localScale.z);
29
30             int star = Data.getData(Data.KEY_STAR + (Attr.currentWorld * 15 + Attr.currentLevel));
31             for (int i = 0; i < 3; i++)
32             {
33                 if (i < star)
34                 {
35                     stars[i].GetComponent().sprite = starSprite;
36                 }
37             }
38
39         }

Better 121 lượt xem

Gõ tìm kiếm nhanh...