Second commit
This commit is contained in:
commit
36840f3ad4
999 files changed
+61364
No files matched your search
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// This file is part of the Tremble package by Tiny Goose.
|
||||
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
|
||||
//
|
||||
|
||||
namespace TinyGoose.Tremble.Editor
|
||||
{
|
||||
[ManualPage("User Generated Content/For Players")]
|
||||
public class UgcPlayerHintsPage : ManualPageBase
|
||||
{
|
||||
protected override void OnGUI()
|
||||
{
|
||||
Experimental();
|
||||
|
||||
Text("This page gives a bit more detail on what players need, in order to import maps");
|
||||
|
||||
H2("How do players get the FGD file/textures/etc?");
|
||||
Text(
|
||||
"These are installed onto the user's computer when you call",
|
||||
$"{nameof(TrembleRuntimeAPI)}.{nameof(TrembleRuntimeAPI.Initialise)},",
|
||||
"so there is no need to distribute these yourself."
|
||||
);
|
||||
|
||||
H2("Do players need a copy of my Unity project to import maps?");
|
||||
Text(
|
||||
"Absolutely not! Just a copy of your game with Tremble installed and configured."
|
||||
);
|
||||
|
||||
H2("Do players need to purchase a licence for Tremble, on the Asset Store?");
|
||||
Text(
|
||||
"Again - absolutely not! Just a copy of your game with Tremble installed and configured."
|
||||
);
|
||||
|
||||
H2("What if players want to use their own textures?");
|
||||
Text(
|
||||
"Generally this is discouraged, especially when distributing user-generated maps.",
|
||||
"However - it is possible! Users should place their textures (PNG only!) into your game's",
|
||||
"Library/baseq3/Textures folder (this will be created on first run). When Tremble",
|
||||
"finds these unexpected textures referenced in a map, it will create Unity",
|
||||
"materials on-the-fly to display them."
|
||||
);
|
||||
Text(
|
||||
"Note, that you will need to distribute these textures with the maps, and place",
|
||||
"them into the correct folder at runtime for this to work when sharing maps between",
|
||||
"players."
|
||||
);
|
||||
|
||||
H2("What about if these textures should be PBR materials?");
|
||||
Text(
|
||||
"Yup - you might want to change the metallic and smoothness parameters when",
|
||||
"importing a user's custom texture. To do that, Tremble uses a naming convention."
|
||||
);
|
||||
PropertyDescription("s[0-100]", "Smoothness percent");
|
||||
PropertyDescription("m[0-100]", "Metallic/metalness percent");
|
||||
Text(
|
||||
"For example, a texture which should be 60% smooth and 100% metal could be named: ",
|
||||
"'MyCoolTexture_s60_m100.png'."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56855e58ea5a449082f0be2069093e76
|
||||
timeCreated: 1723536946
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 277805
|
||||
packageName: Tremble - Map Importer
|
||||
packageVersion: 1.11.1
|
||||
assetPath: Assets/Tremble/Editor/Manual/Pages/UserGeneratedContent/UgcPlayerHintsPage.cs
|
||||
uploadId: 939664
|
||||
@@ -0,0 +1,100 @@
|
||||
//
|
||||
// This file is part of the Tremble package by Tiny Goose.
|
||||
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
|
||||
//
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
namespace TinyGoose.Tremble.Editor
|
||||
{
|
||||
[ManualPage("User Generated Content/Setup", title: "UGC Setup")]
|
||||
public class UgcSetupPage : ManualPageBase
|
||||
{
|
||||
private TrembleSyncSettings m_SyncSettings;
|
||||
|
||||
private bool IsAddressablesInstalled =>
|
||||
#if ADDRESSABLES_INSTALLED
|
||||
true;
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
|
||||
private bool m_IsInstalling;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
m_SyncSettings = TrembleSyncSettings.Get();
|
||||
}
|
||||
|
||||
protected override void OnGUI()
|
||||
{
|
||||
Experimental();
|
||||
|
||||
Text(
|
||||
"Tremble now supports importing maps at runtime, which allows players to create their",
|
||||
"own maps in TrenchBroom, and import it into your game themselves."
|
||||
);
|
||||
|
||||
Text(
|
||||
"You could use something like Unity's UGC package, or Steam Workshop to distribute",
|
||||
"maps to players (which is up to you to implement). Tremble just needs the map file",
|
||||
"to load on disk somewhere, and it will import it at runtime."
|
||||
);
|
||||
|
||||
H1("Setup");
|
||||
Text(
|
||||
"There are a few things to set up first, before you can use this feature. This page",
|
||||
"will help you do that."
|
||||
);
|
||||
|
||||
CheckListItem("Install the Addressables package from Unity", m_IsInstalling || IsAddressablesInstalled, "Install", () =>
|
||||
{
|
||||
m_IsInstalling = true;
|
||||
UnityEditor.PackageManager.Client.Add("com.unity.addressables");
|
||||
});
|
||||
|
||||
CheckListItem("Enable the Tremble setting for UGC", m_SyncSettings.AllowStandaloneImport, "Enable", () =>
|
||||
{
|
||||
SerializedObject so = new(m_SyncSettings);
|
||||
so.FindBackedProperty(nameof(m_SyncSettings.AllowStandaloneImport)).boolValue = true;
|
||||
so.ApplyModifiedPropertiesWithoutUndo();
|
||||
|
||||
TrembleEditorAPI.SyncToTrenchBroom();
|
||||
});
|
||||
|
||||
H1("Initialising the system");
|
||||
{
|
||||
Text(
|
||||
"This step will prepare Tremble for loading maps at runtime.",
|
||||
"Unfortunately, it can lock your game up for about 200ms - so the idea is to do",
|
||||
"this during your game's startup code, to allow Tremble to initialise",
|
||||
"without causing your game to hitch during gameplay."
|
||||
);
|
||||
Code("await TrembleRuntimeAPI.Initialise();");
|
||||
}
|
||||
|
||||
H1("Loading a map at runtime");
|
||||
{
|
||||
Text("Loading a map at runtime couldn't be simpler - simply call the following function:");
|
||||
|
||||
Code(
|
||||
$"{nameof(MapDocument)} map = await {nameof(TrembleRuntimeAPI)}.{nameof(TrembleRuntimeAPI.LoadMapAsync)}(\"C:\\somemap.map\");",
|
||||
"",
|
||||
"// Your map is now in the current scene, if loading succeeded.",
|
||||
"// Check `map.Result` to see if it worked, and the `map.gameObject` is the root",
|
||||
"// of your new map!",
|
||||
"Debug.Log($\"Result: {map.Result}\");",
|
||||
"Debug.Log($\"Loaded map: {map.BspName}\");"
|
||||
);
|
||||
|
||||
H2("Notes");
|
||||
{
|
||||
Bullet("You can also provide additional arguments, such as subdivision parameters and smoothing angles.");
|
||||
Bullet("Tremble respects Application.backgroundLoadingPriority, which you can use to signal how",
|
||||
"much time you want Unity to dedicate per frame to async loading. Higher priorities will load",
|
||||
"your map faster, but at the expense of dropping more frames during the load.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5ecfa2702b44c4b9f03bbacef113cfc
|
||||
timeCreated: 1723448499
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 277805
|
||||
packageName: Tremble - Map Importer
|
||||
packageVersion: 1.11.1
|
||||
assetPath: Assets/Tremble/Editor/Manual/Pages/UserGeneratedContent/UgcSetupPage.cs
|
||||
uploadId: 939664
|
||||
Reference in new issue
Block a user