using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public GameObject obj_Player;
// Use this for
initialization
void Start () {
}
// Update is called once per
frame
void Update ()
{
obj_Player =
GameObject.Find("Sphere");
if (Input.GetKeyDown
(KeyCode.A)) {
obj_Player.transform.position
+= new Vector3 (-0.1f, 0, 0);
} else if
(Input.GetKeyDown (KeyCode.D)) {
obj_Player.transform.position
+= new Vector3 (0.1f, 0, 0);
} else if
(Input.GetKeyDown (KeyCode.W)) {
obj_Player.transform.position
+= new Vector3 (0, 0, 0.1f);
} else if
(Input.GetKeyDown (KeyCode.S)) {
obj_Player.transform.position
+= new Vector3 (0, 0, -0.1f);
}
}
}
-----------------------------------------------------------------------------------------------------
unity材質與貼圖
Creating GUISkins
製作紋路 GIMP for Windows https://www.gimp.org/downloads/
設定格線 > 貼齊格線 > 矩形工具框出範圍 > 填入 黑色 >匯出PNG
回到 unity
下載磚塊材質,放在地板的物件
輸入:磚塊
直接把圖片拉到 plane 即可
沒有留言:
張貼留言