コード例 #1
0
        private void OnPickUp(PickUpAbleComponent arg0)
        {
            var ropeElement = arg0.GetComponentInParent <RopeElement>();

            if (ropeElement)
            {
                ropeSelected = ropeElement;
            }
        }
コード例 #2
0
        private void OnPickUpElement(PickUpAbleComponent arg0)
        {
            var detachItem = arg0.GetComponentInParent <DetachItem>();

            if (detachItem)
            {
                Debug.Log("PickUp:" + arg0);
                detachItem.UnNotice(detachItem.transform);
            }
        }
コード例 #3
0
        private void OnPickStay(PickUpAbleComponent arg0)
        {
            if (!Active)
            {
                return;
            }

            var placeElement = arg0.GetComponentInParent <PlaceElement>();

            if (placeElement)
            {
                TryPlaceObject(placeElement);
            }
        }
コード例 #4
0
        private void OnPickTwinceRight(PickUpAbleComponent obj)
        {
            if (!Active)
            {
                return;
            }

            var item = obj.GetComponentInParent <LinkItem>();

            if (item)
            {
                ElementController.Instence.ClearExtraCreated();
            }

            linkItem = null;
        }
コード例 #5
0
        void OnPickStay(PickUpAbleComponent obj)
        {
            if (!Active)
            {
                return;
            }

            var item = obj.GetComponentInParent <LinkItem>();

            if (item)
            {
                LinkUtil.ClearActivedLinkPort(item);
                linkConnectCtrl.TryConnect();
                pickCtrl.PickStay();
            }

            linkItem = null;
        }
コード例 #6
0
        /// <summary>
        /// 解除连接
        /// </summary>
        /// <param name="obj"></param>
        void OnPickTwinceLeft(PickUpAbleComponent obj)
        {
            if (!Active)
            {
                return;
            }

            var item = obj.GetComponentInParent <LinkItem>();

            if (item)
            {
                this.linkItem = item;
                if (linkItem && !linkItem.Used)
                {
                    linkConnectCtrl.SetActiveItem(linkItem, true);
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// 放下
        /// </summary>
        /// <param name="obj"></param>
        void OnPickDown(PickUpAbleComponent obj)
        {
            if (!Active)
            {
                return;
            }

            var item = obj.GetComponentInParent <LinkItem>();

            if (item)
            {
                LinkUtil.ClearActivedLinkPort(linkItem);
                if (linkItem)
                {
                    linkConnectCtrl.SetDisableItem();
                }
            }
            this.linkItem = null;
        }
コード例 #8
0
        void OnPickUp(PickUpAbleComponent obj)
        {
            if (!Active)
            {
                return;
            }

            var item = obj.GetComponentInParent <LinkItem>();

            if (item)
            {
                this.linkItem = item;
                if (linkItem)
                {
                    linkConnectCtrl.SetActiveItem(linkItem, false);
                    //显示可以所有可以安装的点
                    LinkUtil.TryActiveLinkPorts(linkItem);
                }
            }
        }
コード例 #9
0
        private void OnPickStay(PickUpAbleComponent item)
        {
            var chargeTool = item.GetComponentInParent <ChargeTool>();

            if (chargeTool)
            {
                var currTool = chargeTool;
                if (chargeResource != null)
                {
                    var value = Mathf.Min(currTool.capacity, chargeResource.current);
                    var type  = chargeResource.type;
                    currTool.RetriveFeature <PickUpAbleFeature>().PickUpAble = false;
                    currTool.LoadData(chargeResource.transform.position, new ChargeData(type, value), () =>
                    {
                        currTool.RetriveFeature <PickUpAbleFeature>().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.RetriveFeature <PickUpAbleFeature>().PickUpAble = false;
                        currTool.OnCharge(chargeObj.transform.position, worpData.value, () => { currTool.RetriveFeature <PickUpAbleFeature>().PickUpAble = true; });
                        chargeObj.Charge(worpData, () => { chargeObj.JudgeComplete(); });
                    }
                    highter.UnHighLightTarget(chargeObj.gameObject);
                    lastMatchChargeObj = null;
                }
            }
        }
コード例 #10
0
        private void OnPickDownElement(PickUpAbleComponent arg0)
        {
            var detachItem = arg0.GetComponentInParent <DetachItem>();

            DetachTargetItem(detachItem);
        }