Skip to content
Permalink
Browse files

[Assets] Move assets to Assets folder for now

  • Loading branch information
xen2 committed Aug 30, 2018
1 parent ab5281a commit 1653165995c724ad16cf8329bf96ac6e7145b0f7
@@ -425,7 +425,7 @@ public UDirectory GetDefaultAssetFolder()
{
var sharedProfile = Profiles.FindSharedProfile();
var folder = sharedProfile?.AssetFolders.FirstOrDefault();
return folder?.Path ?? ("Assets/" + PackageProfile.SharedName);
return folder?.Path ?? ("Assets");
}

/// <summary>
@@ -148,7 +148,7 @@ public PackageProfile(string name, params AssetFolder[] folders)
public static PackageProfile NewShared()
{
var sharedProfile = new PackageProfile(SharedName) { Platform = PlatformType.Shared };
sharedProfile.AssetFolders.Add(new AssetFolder("Assets/" + SharedName));
sharedProfile.AssetFolders.Add(new AssetFolder("Assets"));
sharedProfile.ResourceFolders.Add("Resources");
return sharedProfile;
}
@@ -131,17 +131,14 @@ protected override bool Generate(SessionTemplateGeneratorParameters parameters)
// Generate the Game library
var package = ProjectTemplateGeneratorHelper.GenerateTemplate(parameters, platforms, "ProjectLibrary.Game/ProjectLibrary.Game.ttproj", projectGameName, PlatformType.Shared, null, null, ProjectType.Library, orientation);
//projectGameReference.Type = ProjectType.Library;
//sharedProfile.ProjectReferences.Add(projectGameReference);

//package.ProjectFullPath = projectGameReference.Location.ToWindowsPath();

//write gitignore
WriteGitIgnore(parameters);

// Setup the assets folder
Directory.CreateDirectory(UPath.Combine(package.RootDirectory, (UDirectory)"Assets/Shared"));

var sharedProfile = package.Profiles.FindSharedProfile();
//Directory.CreateDirectory(UPath.Combine(package.RootDirectory, (UDirectory)"Assets/Shared"));

var previousCurrent = session.CurrentPackage;
session.Packages.Add(package);
@@ -157,7 +154,7 @@ protected override bool Generate(SessionTemplateGeneratorParameters parameters)
if (cameraScriptTemplate == null)
throw new InvalidOperationException($"Could not find template for script '{CameraScriptDefaultOutputName}'");

var cameraScriptParameters = new AssetTemplateGeneratorParameters(projectGameName)
var cameraScriptParameters = new AssetTemplateGeneratorParameters(string.Empty)
{
Name = cameraScriptTemplate.DefaultOutputName,
Description = cameraScriptTemplate,
@@ -177,7 +174,7 @@ protected override bool Generate(SessionTemplateGeneratorParameters parameters)
SaveSession(parameters);

// Add Effects as an asset folder in order to load xksl
sharedProfile.AssetFolders.Add(new AssetFolder(projectGameName + "/Effects"));
//sharedProfile.AssetFolders.Add(new AssetFolder(projectGameName + "/Effects"));

// Generate executable projects for each platform
//ProjectTemplateGeneratorHelper.UpdatePackagePlatforms(parameters, platforms, orientation, package.Id, name, package, false);
@@ -345,7 +342,7 @@ private void CreateAndSetNewScene(SessionTemplateGeneratorParameters parameters,
}

// Create the texture asset
var skyboxTextureAsset = new TextureAsset { Source = Path.Combine(@"..\..\Resources", skyboxFilename), IsCompressed = isHDR, Type = new ColorTextureType { UseSRgbSampling = false } };
var skyboxTextureAsset = new TextureAsset { Source = Path.Combine(@"../Resources", skyboxFilename), IsCompressed = isHDR, Type = new ColorTextureType { UseSRgbSampling = false } };
var skyboxTextureAssetItem = new AssetItem("Skybox texture", skyboxTextureAsset);
package.Assets.Add(skyboxTextureAssetItem);
skyboxTextureAssetItem.IsDirty = true;

0 comments on commit 1653165

Please sign in to comment.
You can’t perform that action at this time.