Exemplo n.º 1
0
 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;
         }
     }
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public void SpawnSavedCraft(string craftName)
 {
     SpawnCraftFromBlueprint(CraftBlueprint.LoadFromFileByName(craftName));
 }