当前位置:网站首页>2.10transfrom attribute

2.10transfrom attribute

2022-07-06 07:50:00 The ji

How to get more , You can put transfrom, Understand it as an attribute ( Every object can have attributes )

such as     sl = transform.GetChild(0).GetComponent<Slider>(); He is slider In the properties of the . Location . Get components

    game.transform.parent = Content.transform;

And he Content“ After acquiring her components , He still wants some transfrom attribute ”

Go and get game Class transfrom attribute , then .parent Properties of

1. Find components through code

2.playerImg.sprite=imgs[0].sprite; He means that one of his attributes is revealed through it ( stay image On )

3.sT.onClick.AddListener(jdbtn); //AddListener== Add method // Code acquisition button Click events for

1. The first 29 OK, he wants to name one using system Space , He gets time ( Or you could write it as System.DateTime.Now.Tostring(), No need to write namespace .)

2.30 OK, he added a name to the random number , Because random numbers are using system and unityEngince meanwhile

There is , So choose one

3.32-34 OK, he just clones an object ( Text ), Give to the Gameobject game, then To get the text , You need to ,game.getcomponent<text>().text . adopt Gameobject Class go , Get his components text.

parent Method represents a subclass of an object , So put the location attribute , Give it to him game Subclasses of classes .

as follows

原网站

版权声明
本文为[The ji]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131853280971.html