using UnityEngine;
using System.Collections;
public class LineMove01 : MonoBehaviour {
public float speed = -1;
// Use this for initialization
void Start () {
rigidbody2D.velocity = new Vector2(0, speed);
}
// Update is called once per frame
void Update () {
}
}
using UnityEngine;
using System.Collections;
public class LineMove02 : MonoBehaviour {
public float speed = -1.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate(speed*Time.deltaTime,0,0);
//rigidbody2D.velocity = new Vector2(-10.0f, 0);
}
}
World 좌표계에서의 Translate : 함수 오버로딩 => Translate( , , , Space.World)