예제 #1
0
 private void Initialized()
 {
     //绑定事件
     if (BackgroundImage != null)
     {
         UIRockerEventView view = BackgroundImage.GetComponent <UIRockerEventView>();
         if (view != null)
         {
             view.OnRockerBeginDragEvent += OnRoeckerBeginDragEvent;
             view.OnRockerDragEvent      += OnRoeckerDragEvent;
             view.OnRockerEndDragEvent   += OnRoeckerEndDragEvent;
             view.OnRockerPointDownEvent += OnRoeckerBeginDragEvent;
             view.OnRockerPointUpEvent   += OnRoeckerEndDragEvent;
         }
     }
     if (CenterImage != null)
     {
         UIRockerEventView view = CenterImage.GetComponent <UIRockerEventView>();
         if (view != null)
         {
             view.OnRockerBeginDragEvent += OnRoeckerBeginDragEvent;
             view.OnRockerDragEvent      += OnRoeckerDragEvent;
             view.OnRockerEndDragEvent   += OnRoeckerEndDragEvent;
             view.OnRockerPointDownEvent += OnRoeckerBeginDragEvent;
             view.OnRockerPointUpEvent   += OnRoeckerEndDragEvent;
         }
     }
 }
예제 #2
0
 private void Initialize()
 {
     if (CenterImage != null)
     {
         Mini_Rocker_Event centerRockerEvent = CenterImage.GetComponent <Mini_Rocker_Event>();
         if (centerRockerEvent != null)
         {
             centerRockerEvent.onRockerDraggedEvent      += OnRockerCenterDragged;
             centerRockerEvent.onRockerBeginDraggedEvent += OnRockerCenterBeginDragged;
             centerRockerEvent.onRockerEndDraggedEvent   += OnRockerCenterEndDragged;
         }
         Mini_Rocker_Event bgRockerEvent = BackgroundImage.GetComponent <Mini_Rocker_Event>();
         if (bgRockerEvent != null)
         {
             bgRockerEvent.onRockerBeginDraggedEvent += OnRockerCenterBeginDragged;
             bgRockerEvent.onRockerDraggedEvent      += OnRockerCenterDragged;
             bgRockerEvent.onRockerEndDraggedEvent   += OnRockerCenterEndDragged;
         }
     }
 }