public void StartBlueprint(Thing thing) { if (blueprintStructure != null) { Destroy(blueprintStructure); } blueprintMode = BlueprintModes.expanding; expandTimer = 0; this.thing = thing; blueprintStructure = StructureFactory.MakeStructure(thing.thingType, true); blueprintStructure.transform.parent = gameObject.transform; }
public void MakeIfConstructed() { //this turns the blueprint into a real structure. removes nodes, deletes itself, and activates structure. if (IsConstructed()) { GameObject realStructure = StructureFactory.MakeStructure(thing.thingType, false); StructureController structureController = realStructure.GetComponent <StructureController> (); realStructure.transform.position = blueprintStructure.transform.position; realStructure.transform.rotation = blueprintStructure.transform.rotation; Destroy(gameObject); } }