void FixedUpdate() { if (debug_CraftToSave != null) { debug_CraftBlueprint = CraftBlueprint.GetBlueprintFromCraft(debug_CraftToSave); debug_CraftToSave = null; } if (debug_CraftBlueprint != null) { if (debug_SaveCraftBlueprint) { debug_SaveCraftBlueprint = false; CraftBlueprint.SaveToFile(debug_CraftBlueprint); } if (debug_LoadCraftBlueprint) { debug_LoadCraftBlueprint = false; debug_CraftBlueprint = CraftBlueprint.LoadFromFileByName(debug_LoadCraftBlueprintFileName); } if (debug_SpawnCraftBlueprint) { CraftBlueprint.SpawnCraftFromBlueprint(debug_CraftBlueprint, Vector3.up * 10f, Vector3.zero); debug_SpawnCraftBlueprint = false; } if (debug_ForgetCraftBlueprint) { debug_ForgetCraftBlueprint = false; debug_CraftBlueprint = null; } } }
public override void OnCraftSelected(string fileName) { if (!Input.GetKey(KeyCode.LeftShift) || !allowEditing) { spawnMenu.SpawnSavedCraft(fileName); } else //If holding LShift, edit the craft (if allowed). { CraftEditor.instance.EditCraftFromBlueprint(CraftBlueprint.LoadFromFileByName(fileName)); } spawnMenu.CloseMenu(); }
public void SpawnSavedCraft(string craftName) { SpawnCraftFromBlueprint(CraftBlueprint.LoadFromFileByName(craftName)); }