// Update is called once per frame void Update () { switch( m_State ) { case RotateByAngular02State.UnActive : break ; case RotateByAngular02State.Initialization : y = 0 ; z = 0 ; m_State = RotateByAngular02State.Y ; break ; case RotateByAngular02State.Y : y += 0.1f ; this.transform.rotation = Quaternion.identity ; this.transform.Rotate( 0 , y , 0 , Space.Self ) ; if( y > 90 ) { m_PreviousRotation = this.transform.rotation ; m_State = RotateByAngular02State.Z ; } break ; case RotateByAngular02State.Z : z += 0.1f ; this.transform.rotation = m_PreviousRotation ; this.transform.Rotate( 0 , 0 , z , Space.Self ) ; if( z > 90 ) m_State = RotateByAngular02State.End ; break ; case RotateByAngular02State.End : break ; } }
public void ReStart() { m_State = RotateByAngular02State.Initialization ; }