유니티에서 오브젝트의 포지션 로테이션 스케일을 조정해주는 간단한 스크립트
using UnityEngine;
using System.Collections;
public class csInspectorTransform : MonoBehaviour {
public GameObject[] AddObject;
public Vector3[] MoveVector;
public Vector3[] RotateVector;
public Vector3[] ScaleVector;
void Update () {
int count = AddObject.Length;
if(count >0 && count == MoveVector.Length && count == RotateVector.Length && count == ScaleVector.Length)
{
for(int i = 0; i < count; ++i)
{
AddObject[i].transform.localPosition = MoveVector[i];
AddObject[i].transform.localRotation = Quaternion.identity;
AddObject[i].transform.Rotate(RotateVector[i]);
AddObject[i].transform.localScale = ScaleVector[i];
}
}
}
}
'게임개발 > 필기노트' 카테고리의 다른 글
사운드링크 (0) | 2015.11.13 |
---|---|
코루틴 이해하기 (0) | 2015.10.13 |
Console.WriteLine()의 다양한 사용법 (0) | 2015.02.06 |
연산자 (0) | 2015.02.06 |
Parse, const, Nullable (0) | 2015.01.21 |