switch(rotateAxis)
{
case 0: //rotate around X axis
{
rotateVector = Vector3.right;
break;
}
case 1://rotate around Y axis
{
rotateVector = Vector3.up;
break;
}
case 2://rotate around Z axis
{
rotateVector = Vector3.forward;
break;
}
default:
break;
}
deltaRotate = angleRange/rotateDuration;
isRotating = true;
}
public void RotateTo(float _angleRange, int _axis, float _duration, float _accelerateDuration)
{
isRotating = false;
rotateType = CTRotationType.AccelerateUniformly;
//RotateType = 1;
switch(rotateAxis)
{
case 0: //rotate around X axis
{
rotateVector = Vector3.right;
break;
}
case 1://rotate around Y axis
{
rotateVector = Vector3.up;
break;
}
case 2://rotate around Z axis
{
rotateVector = Vector3.forward;
break;
}
default:
break;
}