public override ConstructedRepairComponent GetRepairComponent() { if (finishedRepairComponent != null) { ConstructedRepairComponent returnComponent = finishedRepairComponent; finishedRepairComponent = null; addedComponents.Clear(); ChangePhase(ConstructionPhase.Empty); return(returnComponent); } return(null); }
public override bool AddPickableComponent(PickAbleObject pickAbleObject) { if (pickAbleObject is ConstructedRepairComponent) { ConstructedRepairComponent newComponent = (ConstructedRepairComponent)pickAbleObject; if (currentIssue.seekedWord.ToString() == newComponent.partName) { Destroy(newComponent.gameObject); FixObject(); return(true); } return(false); } return(false); }
private void FinishConstruction() { ChangePhase(ConstructionPhase.Done); constructionTimer = 0; anim.enabled = false; anim.Rebind(); CameraFollowerToPlayer.Instance.ToggleZoomBehaviour(false); //anim.enabled = false; finishedRepairComponent = Instantiate(constructedComponentPrefab, boxParent.position, boxParent.rotation, null).GetComponent <ConstructedRepairComponent>(); foreach (RepairComponent comp in addedComponents) { comp.transform.SetParent(finishedRepairComponent.transform); comp.transform.position = finishedRepairComponent.transform.position; comp.transform.rotation = finishedRepairComponent.transform.rotation; Destroy(comp.GetComponent <Rigidbody>()); Destroy(comp); } string cName = ""; if (IssueManager.Instance.currentIssueList.Values.ToList().Exists(i => i.ComponentsMatchIssue(addedComponents))) { cName = IssueManager.Instance.currentIssueList.Values.ToList().Find(i => i.ComponentsMatchIssue(addedComponents)).ReturnProperName(); } else { IssueManager.Instance.CaseCompindingNotNeeded(addedComponents); foreach (RepairComponent item in addedComponents) { cName += item.partName; } } finishedRepairComponent.partName = cName; }