if( transform.position.x > -15 && transform.rotation.y == 0 )
{
//小鸟X轴反方向移动速度
transform.position += new Vector3(-0.1f,0,0);
}
else
{
//小鸟Y轴旋转,相当于人的转身
transform.localEulerAngles = new Vector3(0,180,0);
}
if(transform.position.x < 15 && transform.rotation.y != 0)
{
//小鸟X轴正方向移动速度
transform.position += new Vector3(0.1f,0,0);
}
else
{
//小鸟Y轴恢复旋转,
transform.localEulerAngles = new Vector3(0,0,0);
}