public void PlaceWrong(PlaceElement pickup) { if (pickup) { pickup.RetriveFeature <PickUpAbleFeature>().OnPickDown(); } }
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); }
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); }
public virtual PlaceElement Detach() { PlaceElement old = contentFeature.Element as PlaceElement; old.onInstallOkEvent -= OnInstallComplete; old.onUnInstallOkEvent -= OnUnInstallComplete; contentFeature.Element = default(PlaceElement); return(old); }
protected override void OnSetInActive(UnityEngine.Object target) { base.OnSetInActive(target); if (!AlreadyPlaced) { PlaceElement obj = GetUnInstalledObj(contentFeature.ElementName, true); obj.QuickInstall(this); obj.SetInActive(this); } }
public virtual void Attach(PlaceElement obj) { if (contentFeature.Element != null) { Debug.LogError(this + "allready attached"); } contentFeature.Element = obj; obj.onInstallOkEvent += OnInstallComplete; obj.onUnInstallOkEvent += OnUnInstallComplete; }
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); } }
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)); } }
/// <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); } }
public abstract void PlaceObject(PlaceElement pickup);
public abstract bool CanPlace(PlaceElement element, out string why);
public override void PlaceObject(PlaceElement pickup) { Attach(pickup); pickup.QuickInstall(this); pickup.PickUpAble = false; }
public void PlaceObject(PlaceItem pos, PlaceElement pickup) { pos.PlaceObject(pickup); }