Posts

Showing posts from September, 2021

How to use Virtual Camera to follow a GameObject

 How to use Virtual Camera to follow a GameObject Way1:Cinemachine Virtual Camera package (1)Install cinemachine virtual camera package (2)drag object  to the properties "follow"

How to Create Button in Unity with code?

 How to Create Button in Unity with code? Way1:Use Instantiate function. Create Button  in Unity manually. Then drag it to a variable. After that, write the line such as Instantiate(obj); P.S. (1)I can not find way to set both the width and the height of the button now in this way. Way2:GUILayout.Button GUILayout is a class that  can create UI Object. P.S. (1) GUILayout can be written in OnGUI function. When GUILayout was called in other function. There is an ArgumentException  before play mode. (2)void OnGUI()  is a built-in function. It is case-sensitive, so OnGui() was not accepted. When you override it, you will see the color of OnGUI is blue when you code in visual studio 2019. (3)When is OnGUI() invoked? it is invoked several times per frame (or per time when the event is triggered). (4)I can find way to set both the width and the height of the button now in this way. pass the width and height as argument when you call GUILayout.Button. more details on: U...

DrawDefaultInspector()

 DrawDefaultInspector(); syntax:  DrawDefaultInspector();

SendMessage To Other GameObject in Unity -- SendMessage v.s. SendMessageTorward v.s. BroadcastMessage in Unity

 SendMessage To Other GameObject in Unity --  SendMessage v.s. SendMessageTorward v.s. BroadcastMessage in Unity introduction: Do you remember about GameObject in Unity. You can create lots of objects in Unity.

how to install a package in unity - unity

how to install a package in unity - unity  (1)open unity (2)select menu bar (Window->package manager) and a window which title is "package manager" pops up. (3)select menu bar (package registry) (4)type package's name that you want to download in search line. (5)check the information and install it. Resource: more details on: 10.unity攝影機跟隨功能(Cinemachine) - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天 (ithome.com.tw)