using UnityEngine;

using System.Collections;


public class UpDownRotate : MonoBehaviour {

public float rotateSpeed = 60.0f;


// Update is called once per frame

void Update () {

float v = Input.GetAxis("Vertical");

float currentAngle = transform.eulerAngles.z;

currentAngle += v *rotateSpeed * Time.deltaTime;

currentAngle = Mathf.Clamp(currentAngle,0f,90f);   //limit value

transform.rotation = Quaternion.Euler(Vector3.forward * currentAngle);

}

}

 


'유니티3D > 예제' 카테고리의 다른 글

2DGameScripts  (0) 2013.09.10
Shoot  (0) 2013.09.03
StreetLight.cs  (0) 2013.08.26
gamemanagel.cs  (0) 2013.08.26
powercell.cs  (0) 2013.08.26

+ Recent posts