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

Method CanCreate

Source/Editor/Content/Proxy/ScriptProxy.cs:51–67  ·  view source on GitHub ↗

(ContentFolder targetLocation)

Source from the content-addressed store, hash-verified

49
50 /// <inheritdoc />
51 public override bool CanCreate(ContentFolder targetLocation)
52 {
53 if (targetLocation.CanHaveScripts)
54 {
55 var path = targetLocation.Path;
56 var projects = Editor.Instance.GameProject.GetAllProjects();
57 foreach (var project in projects)
58 {
59 var projectSourceFolderPath = StringUtils.CombinePaths(project.ProjectFolderPath, "Source");
60 if (path == projectSourceFolderPath)
61 return false;
62 if (path.StartsWith(projectSourceFolderPath))
63 return true;
64 }
65 }
66 return false;
67 }
68
69 /// <inheritdoc />
70 public override bool IsFileNameValid(string filename)

Callers

nothing calls this directly

Calls 3

CombinePathsMethod · 0.80
GetAllProjectsMethod · 0.45
StartsWithMethod · 0.45

Tested by

no test coverage detected