private void OnPickUpElement(PickUpAbleItem arg0)
 {
     if (arg0 is DetachItem)
     {
         Debug.Log("PickUp:" + arg0);
     }
 }
        private void OnPickStay(PickUpAbleItem item)
        {
            if (item is ChargeTool)
            {
                var currTool = chargeTool;
                if (chargeResource != null)
                {
                    var value = Mathf.Min(currTool.capacity, chargeResource.current);
                    var type  = chargeResource.type;
                    currTool.PickUpAble = false;
                    currTool.LoadData(chargeResource.transform.position, new ChargeData(type, value), () => {
                        currTool.PickUpAble = true;
                    });
                    chargeResource.Subtruct(value, () => { });

                    highter.UnHighLightTarget(chargeResource.gameObject);
                    lastMatchChargeResource = chargeResource = null;
                }
                else if (chargeObj != null)
                {
                    var        data     = currTool.data;
                    ChargeData worpData = chargeObj.JudgeLeft(data);
                    if (!string.IsNullOrEmpty(worpData.type))
                    {
                        currTool.PickUpAble = false;
                        currTool.OnCharge(chargeObj.transform.position, worpData.value, () => { currTool.PickUpAble = true; });
                        chargeObj.Charge(worpData, () => { chargeObj.JudgeComplete(); });
                    }
                    highter.UnHighLightTarget(chargeObj.gameObject);
                    lastMatchChargeObj = null;
                }
            }
        }
Example #3
0
 private void OnPickStay(PickUpAbleItem arg0)
 {
     if (arg0 is PlaceElement)
     {
         TryPlaceObject(arg0 as PlaceElement);
     }
 }
        public override bool CanPlace(PickUpAbleItem element, out string why)
        {
            var matchAble = true;

            if (this == null)
            {
                why = "【配制错误】:零件未挂MatchObj脚本";
                Debug.LogError("【配制错误】:零件未挂MatchObj脚本");
                matchAble = false;
            }
            else if (!this.Started)
            {
                matchAble = false;
                why       = "操作顺序错误";
            }
            else if (this.AlreadyPlaced)
            {
                matchAble = false;
                why       = "已经触发结束";
            }
            else if (this.Name != element.Name)
            {
                matchAble = false;
                why       = "零件不匹配";
            }
            else
            {
                why       = null;
                matchAble = true;
            }
            return(matchAble);
        }
        public override bool CanPlace(PickUpAbleItem element, out string why)
        {
            why = null;
            var canplace = true;

            if (!this.Started)
            {
                canplace = false;
                why      = "操作顺序错误";
            }
            else if (this.AlreadyPlaced)
            {
                canplace = false;
                why      = "已经安装";
            }

            else if (element.Name != this.Name)
            {
                canplace = false;
                why      = "零件不匹配";
            }
            else
            {
                canplace = true;
            }
            return(canplace);
        }
Example #6
0
 private void OnPickUp(PickUpAbleItem arg0)
 {
     if (arg0 is RopeItem)
     {
         ropeSelected = arg0 as RopeItem;
     }
 }
Example #7
0
 private void OnPickStay(PickUpAbleItem arg0)
 {
     if (ropeSelected != null && ropeSelected.BindingTarget != null)
     {
         ropeSelected.BindingTarget.TryPlaceRope(ropeSelected);
     }
 }
 private void OnPickTwinceRight(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         ElementController.Instence.ClearExtraCreated();
     }
 }
 void OnPickStay(PickUpAbleItem go)
 {
     if (go is LinkItem)
     {
         LinkUtil.ClearActivedLinkPort(go as LinkItem);
         linkConnectCtrl.TryConnect();
         pickCtrl.PickStay();
     }
 }
 /// <summary>
 /// 解除连接
 /// </summary>
 /// <param name="obj"></param>
 void OnPickTwinceLeft(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         linkItem = obj as LinkItem;
         if (linkItem && !linkItem.Used)
         {
             linkConnectCtrl.SetActiveItem(linkItem, true);
         }
     }
 }
 /// <summary>
 /// 放下
 /// </summary>
 /// <param name="obj"></param>
 void OnPickDown(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         LinkUtil.ClearActivedLinkPort(obj as LinkItem);
         var linkItem = obj as LinkItem;
         if (linkItem)
         {
             linkConnectCtrl.SetDisableItem();
         }
     }
 }
Example #12
0
 public bool CanPlace(PlaceObj pos, PickUpAbleItem element, out string why)
 {
     if (pos == null)
     {
         Debug.LogError("");
         why = "【配制错误】:零件未挂PlaceObj脚本";
         return(false);
     }
     else
     {
         return(pos.CanPlace(element, out why));
     }
 }
 void OnPickUp(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         linkItem = obj as LinkItem;
         if (linkItem)
         {
             linkConnectCtrl.SetActiveItem(linkItem, false);
             //显示可以所有可以安装的点
             LinkUtil.TryActiveLinkPorts(linkItem);
         }
     }
 }
Example #14
0
 public abstract bool CanPlace(PickUpAbleItem element, out string why);
Example #15
0
 private void OnPickUpItem(PickUpAbleItem arg0)
 {
     Debug.Log("PickedUp:" + arg0);
 }
Example #16
0
 private void OnPickDown(PickUpAbleItem arg0)
 {
 }
Example #17
0
 private void OnPickTwince(PickUpAbleItem arg0)
 {
 }