public void PlaceWrong(PickUpAbleElement pickup) { if (pickup) { pickup.OnPickDown(); } }
public void PlaceWrong(PickUpAbleElement pickup) { if (pickup) { pickup.NormalUnInstall(); } }
public virtual PickUpAbleElement Detach() { PickUpAbleElement old = obj; old.onInstallOkEvent -= OnInstallComplete; old.onUnInstallOkEvent -= OnUnInstallComplete; obj = default(PickUpAbleElement); return(old); }
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(); } }
public void RemoveElement(PickUpAbleElement item) { foreach (var objItem in objectList) { if (item.Name == objItem.Key) { if (objItem.Value.Contains(item)) { objItem.Value.Remove(item); } } } }
/// <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; }