MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / TryBuildCommand

Method TryBuildCommand

Source/Editor/Editor.cs:1457–1505  ·  view source on GitHub ↗
(string arg)

Source from the content-addressed store, hash-verified

1455 }
1456
1457 private bool TryBuildCommand(string arg)
1458 {
1459 if (GameCooker.IsRunning)
1460 return true;
1461 if (arg == null)
1462 return true;
1463
1464 Editor.Log("Using CL build for \"" + arg + "\"");
1465
1466 int dotPos = arg.IndexOf('.');
1467 string presetName, targetName;
1468 if (dotPos == -1)
1469 {
1470 presetName = arg;
1471 targetName = string.Empty;
1472 }
1473 else
1474 {
1475 presetName = arg.Substring(0, dotPos);
1476 targetName = arg.Substring(dotPos + 1);
1477 }
1478
1479 var settings = GameSettings.Load<BuildSettings>();
1480 var preset = settings.GetPreset(presetName);
1481 if (preset == null)
1482 {
1483 Editor.LogWarning("Missing preset.");
1484 return true;
1485 }
1486
1487 if (string.IsNullOrEmpty(targetName))
1488 {
1489 Windows.GameCookerWin.BuildAll(preset);
1490 }
1491 else
1492 {
1493 var target = preset.GetTarget(targetName);
1494 if (target == null)
1495 {
1496 Editor.LogWarning("Missing target.");
1497 return true;
1498 }
1499
1500 Windows.GameCookerWin.Build(preset, target);
1501 }
1502
1503 Windows.GameCookerWin.ExitOnBuildQueueEnd();
1504 return false;
1505 }
1506
1507 internal IntPtr GetMainWindowPtr()
1508 {

Callers

nothing calls this directly

Calls 7

SubstringMethod · 0.80
GetPresetMethod · 0.80
LogMethod · 0.45
IndexOfMethod · 0.45
LogWarningMethod · 0.45
GetTargetMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected