บทความ

กำลังแสดงโพสต์จาก มีนาคม, 2013

Unity3d: Shoot Em_Up Tutorial 3 - Player Movement

3.1 ทดลองสร้างสคริปต์ ในหน้าต่าง Project ให้สร้างสคริปต์ C# Script ชื่อ Assets > Scripts > Player > PlayerMovement ลากสคริปต์ PlayerMovement ที่สร้างไว้ใส่ไปที่ Player ในหน้าต่าง Hierarchy 3.2 ดูรายละเอียดของสคริปต์ เข้าไปที่ http://docs.unity3d.com/Documentation/ScriptReference/index.html สั่งค้นหาคำว่า Transform จากนั้นพอหน้าจอแสดงผลการค้นหาออกมา ให้กดที่ Transform  แล้วสั้งเกตในหมวดหมู่ Functions จะพบคำว่า Translate          Moves the transform in the direction and distance of translation. ให้กดที่คำว่า Translate จะพบข้อมูลของ Transform.Translate กดเปลี่ยนประเภทของสคริปต์เป็น C# จะพบการเปลี่ยนแปลงของสคริปต์ 3.3 ทดลองแก้ไข  C# Script กดดับเบิ้ลคลิกที่ PlayerMovement ซึ่งถูกสร้างขึ้นมา โดยจะพบค่าเริ่มต้นของสคริปต์ถูกเขียนไว้ว่า using UnityEngine; using System.Collections; public class PlayerMovement : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } } 3.4 ทำให้ Player เคลื่อนที่ได้เอง ที่บรรทัดข้

Unity3d: Shoot Em_ Up Tutorial 2 - Setting up the scene

วิธีติดตั้งคือ คลิกขวาแล้วเลือก Run as Adminnister x: 0 y: -3.74519 z: 0