For scripting, Unity3D supports three languages, Java Script, C#, and Boo, and these
all can be used for one project. Thus, we can make scripts freely, being undeterred by
a certain language. However, only one language can be used within one script. One
thing we must know first when making scripts using Unity3D is References that
enable Overriding. Among them, the most important things are Update, LateUpdate,
FixedUpdate, Awake, and Start. The Update function is called for every frame when
the script is on. We can use Time.deltaTime, the most frequently used function in the
script, when we want to know the past time. The LateUpdate function is also called
for every frame, and is called after every Update function is called. The FixedUpdate
function is also called for every frame, and is used in substitute for the Update
function when dealing with Rigibody. The Awake function is called until the script
object is loaded. It is used to initialize variables or statuses before game starts, and is
called only once during the lifetime of the script object. The Awake function can use
functions such as GameObject.FindWithTag safely because every objects is
initialized and called. The Start function is called when the Update function is called
first, right before the Update function. It is called only once during the lifetime of the
script object, and the Awake function is always called before the Start function
สำหรับการเขียนสคริปต์ unity3d , สนับสนุนสามภาษา , Java Script , C #และบูและเหล่านี้
ทั้งหมดสามารถใช้สำหรับหนึ่งโครงการ ดังนั้นเราจึงสามารถทำให้สคริปต์ได้อย่างอิสระ จะไม่มีใครขัดขวางโดย
ภาษาบาง แต่เพียงภาษาเดียวเท่านั้นที่สามารถใช้ในสคริปต์ สิ่งที่เราต้องรู้ก่อนหนึ่ง
เมื่อทำสคริปต์การใช้ unity3d คือการอ้างอิงที่
ให้แทน . ในหมู่พวกเขาสิ่งที่สำคัญที่สุด สิ่งที่มีการปรับปรุง lateupdate
fixedupdate , , ตื่นและเริ่ม ฟังก์ชั่นการปรับปรุงเรียกว่าทุกเฟรมเมื่อ
บทคือ เราสามารถใช้ time.deltatime , ใช้บ่อยที่สุดในการทำงาน
บท เมื่อเราต้องการทราบว่าเวลาที่ผ่านมา ฟังก์ชัน lateupdate เรียกว่า
ทุกเฟรม และเรียกว่าหลังการปรับปรุงทุกฟังก์ชันที่เรียกว่า การ fixedupdate
ฟังก์ชันเรียกว่าทุกเฟรม และใช้ในการแทนฟังก์ชันการปรับปรุง
เมื่อจัดการกับ rigibody . หน้าที่แล้วเรียกว่าจนกว่าบท
วัตถุคือโหลด มันถูกใช้เพื่อเรียกใช้งานตัวแปรหรือสถานะก่อนเริ่มเกม และเป็น
เรียกเพียงครั้งเดียวในช่วงชีวิตของสคริปต์วัตถุ หน้าที่แล้วสามารถใช้ฟังก์ชันเช่น gameobject
.findwithtag อย่างปลอดภัยเพราะทุกวัตถุ
เริ่มต้นและเรียก ฟังก์ชันเริ่มต้นเรียกว่าเมื่อฟังก์ชั่นการปรับปรุงเรียกว่า
ก่อน ใช่ก่อนฟังก์ชันการปรับปรุง มันถูกเรียกว่าครั้งเดียวในช่วงชีวิตของ
สคริปต์วัตถุและฟังก์ชั่นที่ตื่นตัวอยู่เสมอ เรียกว่า ก่อนที่ฟังก์ชันเริ่มต้น
การแปล กรุณารอสักครู่..
