2014. 3. 12. 19:24 [SnowDog]/개발
[Unity] transform.position.x 수정
transform.position.x -= Time.deltaTime
이런식으로 쓰려고했는데 쓸 수 없었다
position struct member들은 읽기만 가능하고 수정할 수는 없다고 한다
대신에 수정하려면
Vector3 temp = transform.position;
temp.x -= Time.deltaTime;
transform.position = temp;
이런식으로 코딩해야 한다
관련 링크
http://answers.unity3d.com/questions/314488/tramsformposition-consider-storing-temp-variable-c.html
'[SnowDog] > 개발' 카테고리의 다른 글
[Unity] depth only 카메라 잔상 (0) | 2014.03.13 |
---|---|
[Unity] GetComponentsInChildren 사용 관련 (0) | 2014.03.12 |
TortoiseHG (0) | 2014.03.11 |
[Unity] iTween oncompletetarget (0) | 2014.03.06 |
[Unity] C# Xml Parsing (0) | 2014.03.05 |