예제 #1
0
 public void PlaceWrong(PlaceElement pickup)
 {
     if (pickup)
     {
         pickup.RetriveFeature <PickUpAbleFeature>().OnPickDown();
     }
 }
예제 #2
0
        public override bool CanPlace(PlaceElement element, out string why)
        {
            why = null;
            var canplace = true;

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

            else if (contentFeature.ElementName != element.Name)
            {
                canplace = false;
                why      = "零件不匹配";
            }
            else
            {
                canplace = true;
            }
            return(canplace);
        }
예제 #3
0
        public override bool CanPlace(PlaceElement element, out string why)
        {
            var matchAble = true;

            if (this == null)
            {
                why = "【配制错误】:零件未挂MatchObj脚本";
                Debug.LogError("【配制错误】:零件未挂MatchObj脚本");
                matchAble = false;
            }
            else if (!this.Actived)
            {
                matchAble = false;
                why       = "操作顺序错误";
            }
            else if (contentFeature.Element != null)
            {
                matchAble = false;
                why       = "已经触发结束";
            }
            else if (contentFeature.ElementName != element.Name)
            {
                matchAble = false;
                why       = "零件不匹配";
            }
            else
            {
                why       = null;
                matchAble = true;
            }
            return(matchAble);
        }
예제 #4
0
        public virtual PlaceElement Detach()
        {
            PlaceElement old = contentFeature.Element as PlaceElement;

            old.onInstallOkEvent   -= OnInstallComplete;
            old.onUnInstallOkEvent -= OnUnInstallComplete;
            contentFeature.Element  = default(PlaceElement);
            return(old);
        }
예제 #5
0
 protected override void OnSetInActive(UnityEngine.Object target)
 {
     base.OnSetInActive(target);
     if (!AlreadyPlaced)
     {
         PlaceElement obj = GetUnInstalledObj(contentFeature.ElementName, true);
         obj.QuickInstall(this);
         obj.SetInActive(this);
     }
 }
예제 #6
0
        public virtual void Attach(PlaceElement obj)
        {
            if (contentFeature.Element != null)
            {
                Debug.LogError(this + "allready attached");
            }

            contentFeature.Element  = obj;
            obj.onInstallOkEvent   += OnInstallComplete;
            obj.onUnInstallOkEvent += OnUnInstallComplete;
        }
예제 #7
0
        public override void OnAutoExecute(UnityEngine.Object node)
        {
            PlaceElement obj = GetUnInstalledObj(contentFeature.ElementName, true);

            if (Config.Instence.quickMoveElement && !ignorePass)
            {
                obj.QuickInstall(this);
            }
            else
            {
                obj.NormalInstall(this);
            }
        }
예제 #8
0
 public bool CanPlace(PlaceItem pos, PlaceElement element, out string why)
 {
     if (pos == null)
     {
         Debug.LogError("");
         why = "【配制错误】:零件未挂PlaceObj脚本";
         return(false);
     }
     else
     {
         return(pos.CanPlace(element, out why));
     }
 }
예제 #9
0
        /// <summary>
        /// 尝试安装元素
        /// </summary>
        void TryPlaceObject(PlaceElement pickedObj)
        {
            ray = viewCamera.ScreenPointToRay(Input.mousePosition);
            if (installAble)
            {
                PlaceObject(installPos, pickedObj);
            }
            else
            {
                PlaceWrong(pickedObj);
                SetUserErr(resonwhy);
            }

            installAble = false;

            if (activeNotice)
            {
                highLight.UnHighLightTarget(pickedObj.ViewObj);
            }
        }
예제 #10
0
 public abstract void PlaceObject(PlaceElement pickup);
예제 #11
0
 public abstract bool CanPlace(PlaceElement element, out string why);
예제 #12
0
 public override void PlaceObject(PlaceElement pickup)
 {
     Attach(pickup);
     pickup.QuickInstall(this);
     pickup.PickUpAble = false;
 }
예제 #13
0
 public void PlaceObject(PlaceItem pos, PlaceElement pickup)
 {
     pos.PlaceObject(pickup);
 }