Exemple #1
0
 /// <summary>
 /// 初始化
 /// </summary>
 public void Start()
 {
     str      = new DragUIStr();
     entity   = (Drag2dDataEntity)GetComponent <Drag2dDataModel>().DataEntity;
     _ThisPos = this.transform.position;
     YSize    = this.gameObject.transform.GetComponent <RectTransform>().rect.y;
     XSize    = this.gameObject.transform.GetComponent <RectTransform>().rect.width;
     array    = gameObject.GetComponentsInChildren <DataModelBehaviour>();
 }
Exemple #2
0
 /// <summary>
 /// 处理业务逻辑
 /// </summary>
 /// <param name="evt"></param>
 public override void ProcessLogic(PropertyMessage evt)
 {
     //拖动消息
     if (evt.PropertyName.Equals("DragUIMessage"))
     {
         //如果在开始拖动
         if (((DragUIStr)evt.NewValue).isDragUI)
         {
             DragUIStr str = (DragUIStr)evt.NewValue;
             for (int i = 0; i < array.Length; i++)
             {
                 if (array[i].DataEntity.objectID == str.objectID)
                 {
                     array[i].transform.position = str.newPosition;
                 }
             }
         }
     }
 }
Exemple #3
0
        /// <summary>
        /// 结束拖拽
        /// </summary>
        /// <param name="Obj"></param>
        public void OnMouseIsEndDrag(GameObject Obj)
        {
            DragUIStr str = new DragUIStr();

            str.isDragUI = false;
        }