Exemplo n.º 1
0
 /// 激活首要对象
 /// </summary>
 /// <param name="obj"></param>
 internal void OnPickUpObj(PickUpAbleItem obj)
 {
     if (activeObjCtrl != null)
     {
         activeObjCtrl.OnPickUpObj(obj);
     }
 }
Exemplo n.º 2
0
        public bool CanPlace(PlaceObj placeObj, PickUpAbleItem element, out string why)
        {
            why = null;
            var canplace = true;

            if (placeObj == null)
            {
                Debug.LogError("【配制错误】:零件未挂InstallObj脚本");
            }
            else if (!placeObj.Started)
            {
                canplace = false;
                why      = "操作顺序错误";
            }
            else if (placeObj.AlreadyPlaced)
            {
                canplace = false;
                why      = "已经安装";
            }

            else if (element.Name != placeObj.Name)
            {
                canplace = false;
                why      = "零件不匹配";
            }
            else
            {
                canplace = true;
            }
            return(canplace);
        }
Exemplo n.º 3
0
 private void OnPickUp(PickUpAbleItem arg0)
 {
     if (arg0 is RopeItem)
     {
         ropeSelected = arg0 as RopeItem;
     }
 }
        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;
                }
            }
        }
Exemplo n.º 5
0
        public bool CanPlace(PlaceObj matchPos, PickUpAbleItem element, out string why)
        {
            var matchAble = true;

            if (matchPos == null)
            {
                why = "【配制错误】:零件未挂MatchObj脚本";
                Debug.LogError("【配制错误】:零件未挂MatchObj脚本");
                matchAble = false;
            }
            else if (!matchPos.Started)
            {
                matchAble = false;
                why       = "操作顺序错误";
            }
            else if (matchPos.AlreadyPlaced)
            {
                matchAble = false;
                why       = "已经触发结束";
            }
            else if (matchPos.Name != element.Name)
            {
                matchAble = false;
                why       = "零件不匹配";
            }
            else
            {
                why       = null;
                matchAble = true;
            }
            return(matchAble);
        }
Exemplo n.º 6
0
 private void OnPickTwinceRight(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         ElementController.Instence.ClearExtraCreated();
     }
 }
Exemplo n.º 7
0
 private void OnPickStay(PickUpAbleItem arg0)
 {
     if (ropeSelected != null && ropeSelected.BindingTarget != null)
     {
         ropeSelected.BindingTarget.TryPlaceRope(ropeSelected);
     }
 }
 void OnPickDown(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         linkConnectCtrl.SetDisableItem(obj as LinkItem);
         linkObj.TryActiveLinkItem();
     }
 }
Exemplo n.º 9
0
 void OnPickStay(PickUpAbleItem go)
 {
     if (go is LinkItem)
     {
         LinkUtil.ClearActivedLinkPort(go as LinkItem);
         linkConnectCtrl.TryConnect();
         pickCtrl.PickStay();
     }
 }
 void OnPickStay(PickUpAbleItem go)
 {
     if (go is LinkItem)
     {
         linkConnectCtrl.TryConnect();
         pickCtrl.PickDown();
         Debug.Log("OnPickStatu");
     }
 }
        internal void OnPickUpObj(PickUpAbleItem obj)
        {
            var prio = startedActions.Find(x => x.Name == obj.Name);

            if (prio != null)
            {
                startedActions.Remove(prio);
                startedActions.Insert(0, prio);
            }
        }
Exemplo n.º 12
0
 /// <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);
         }
     }
 }
Exemplo n.º 13
0
 /// <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();
         }
     }
 }
Exemplo n.º 14
0
 void OnPickUp(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         linkItem = obj as LinkItem;
         if (linkItem)
         {
             linkConnectCtrl.SetActiveItem(linkItem, false);
             //显示可以所有可以安装的点
             LinkUtil.TryActiveLinkPorts(linkItem);
         }
     }
 }
 internal void PickUp(PickUpAbleItem pickedUpObj)
 {
     if (pickedUpObj != null)
     {
         this.pickedUpObj = pickedUpObj;
         pickedUpObj.OnPickUp();
         if (this.onPickup != null)
         {
             onPickup.Invoke(pickedUpObj);
         }
         elementDistence = Vector3.Distance(viewCamera.transform.position, pickedUpObj.Collider.transform.position);
     }
 }
 void OnPickUp(PickUpAbleItem obj)
 {
     if (obj is LinkItem)
     {
         var linkItem = obj as LinkItem;
         if (linkItem)
         {
             linkObj = linkItem.GetComponentInParent <LinkObj>();
             linkObj.TryActiveLinkPort(linkItem);
             if (linkObj)
             {
                 linkConnectCtrl.SetState(linkObj.transform, linkObj.ConnectedDic);
                 linkConnectCtrl.SetActiveItem(linkItem);
             }
         }
     }
 }
Exemplo n.º 17
0
 private void OnPickTwince(PickUpAbleItem arg0)
 {
 }
 public bool CanPlace(PlaceObj placeItem, PickUpAbleItem element, out string why)
 {
     return(current.CanPlace(placeItem, element, out why));
 }
Exemplo n.º 19
0
 private void OnPickDown(PickUpAbleItem arg0)
 {
 }