public void DisplayShip(FrameBlueprint frame) { displayedFrame = frame; fullname.text = frame.objectName+", "+frame.className+"-class"; }
public void SetCurrentFrame(FrameBlueprint frame) { if (editedship.transform.childCount > 0) {//throws an error if there is no children Transform oldframe = editedship.transform.GetChild (0); Destroy(oldframe.gameObject); } Transform selectedFrame = frame.CreateGameObject().transform; selectedFrame.GetComponent<Unit> ().enabled = false; selectedFrame.SetParent (editedship.transform); selectedFrame.position = editedship.transform.position; editedUnit = selectedFrame.GetComponent<Unit> (); costDisplay.ClearDisplay (); hardpointDisplay.displayHardpoints (editedUnit); foreach (ResourceType r in editedUnit.GetCost().Keys) { costDisplay.UpdateResource(r, -editedUnit.GetCost()[r]); } }