public void PlaceWrong(PickUpAbleElement pickup)
 {
     if (pickup)
     {
         pickup.OnPickDown();
     }
 }
 public void PlaceWrong(PickUpAbleElement pickup)
 {
     if (pickup)
     {
         pickup.NormalUnInstall();
     }
 }
Example #3
0
        public virtual PickUpAbleElement Detach()
        {
            PickUpAbleElement old = obj;

            old.onInstallOkEvent   -= OnInstallComplete;
            old.onUnInstallOkEvent -= OnUnInstallComplete;
            obj = default(PickUpAbleElement);
            return(old);
        }
Example #4
0
        public virtual void Attach(PickUpAbleElement obj)
        {
            if (this.obj != null)
            {
                Debug.LogError(this + "allready attached");
            }

            this.obj                = obj;
            obj.onInstallOkEvent   += OnInstallComplete;
            obj.onUnInstallOkEvent += OnUnInstallComplete;
        }
        protected override void OnBeforeEnd(bool force)
        {
            base.OnBeforeEnd(force);

            if (!AlreadyPlaced)
            {
                PickUpAbleElement obj = GetUnInstalledObj(Name);
                Attach(obj);
                obj.QuickInstall(this);
                obj.StepComplete();
            }
        }
Example #6
0
 public void RemoveElement(PickUpAbleElement item)
 {
     foreach (var objItem in objectList)
     {
         if (item.Name == objItem.Key)
         {
             if (objItem.Value.Contains(item))
             {
                 objItem.Value.Remove(item);
             }
         }
     }
 }
Example #7
0
 /// <summary>
 /// 外部添加Element
 /// </summary>
 public void RegistElement(PickUpAbleElement item)
 {
     if (objectList.ContainsKey((string)item.Name))
     {
         objectList[(string)item.Name].Add((PickUpAbleElement)item);
     }
     else
     {
         objectList[(string)item.Name] = new System.Collections.Generic.List <PickUpAbleElement>()
         {
             item
         };
     }
 }
        protected override void OnAutoInstall()
        {
            PickUpAbleElement obj = GetUnInstalledObj(Name);

            Attach(obj);
            obj.StepActive();
            if (Config.quickMoveElement && !ignorePass)
            {
                obj.QuickInstall(this);
            }
            else
            {
                obj.NormalInstall(this);
            }
        }
 public void PlaceWrong(PickUpAbleElement pickup)
 {
     current.PlaceWrong(pickup);
 }
 public void PlaceObject(PlaceObj pos, PickUpAbleElement pickup)
 {
     current.PlaceObject(pos, pickup);
 }
 public void PlaceObject(PlaceObj pos, PickUpAbleElement pickup)
 {
     pos.Attach(placeCtrl.pickedUpObj);
     placeCtrl.pickedUpObj.QuickInstall(pos, false, false);
 }
 public void PlaceObject(PlaceObj pos, PickUpAbleElement pickup)
 {
     pos.Attach(pickup);
     pickup.QuickInstall(pos);
     pickup.PickUpAble = false;
 }