Beispiel #1
0
        public override void OnEnter()
        {
            gesture = GestureUtils.GetGesture <SimpleRotateGesture>(Fsm, GameObject, Component, true);
            if (gesture == null)
            {
                LogError("Gesture is missing");
                return;
            }

            gesture.RotateStarted   += gestureRotateStartedHandler;
            gesture.Rotated         += gestureRotatedHandler;
            gesture.RotateCompleted += gestureRotateCompletedHandler;
        }
 /// <summary>
 /// Updates this element's rotatable property.
 /// </summary>
 private void UpdateRotatable()
 {
     if (m_isRotatable && (m_simpleRotateGesture == null || !m_simpleRotateGesture.enabled))
     {
         m_simpleRotateGesture         = this.gameObject.AddComponentNoDupe <SimpleRotateGesture>();
         m_simpleRotateGesture.enabled = true;
     }
     else if (!m_isRotatable && m_simpleRotateGesture != null)
     {
         Destroy(m_simpleRotateGesture);
         m_simpleRotateGesture = null;
     }
 }