Skip to content

Commit c23c44b

Browse files
authored
Merge pull request #472 from umasteeringgroup/MeshModifiers
Welcome now pops up at start
2 parents ddbb2bd + 84de16d commit c23c44b

File tree

5 files changed

+173
-102
lines changed

5 files changed

+173
-102
lines changed

UMAProject/Assets/UMA/Core/Editor/Scripts/ImportProcessor.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
2222
return;
2323
}
2424

25-
25+
26+
EnsureTags();
2627
if (!settings.Initialized)
2728
{
2829
settings.Initialized = true;
29-
EnsureTags();
3030
EnsureUMAIndicators();
3131
EditorUtility.SetDirty(settings);
3232
AssetDatabase.SaveAssetIfDirty(settings);
@@ -37,7 +37,7 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
3737
return;
3838
}
3939

40-
int chosen = EditorUtility.DisplayDialogComplex("UMA " + UmaAboutWindow.umaVersion, "New UMA version imported. The global index should be rebuilt or restored (if you made a backup). (If you don't know what this means, choose 'Rebuild Index')", "Rebuild Index", "Restore from backup", "Do nothing");
40+
/*int chosen = EditorUtility.DisplayDialogComplex("UMA " + UmaAboutWindow.umaVersion, "New UMA version imported. The global index should be rebuilt or restored (if you made a backup). (If you don't know what this means, choose 'Rebuild Index')", "Rebuild Index", "Restore from backup", "Do nothing");
4141
4242
switch (chosen)
4343
{
@@ -82,7 +82,7 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
8282
default:
8383
EditorUtility.DisplayDialog("UMA " + UmaAboutWindow.umaVersion, "You can rebuild or restore the library from the Global Library window accessable from the UMA menu above.", "OK");
8484
break;
85-
}
85+
} */
8686
}
8787
}
8888

UMAProject/Assets/UMA/Core/Editor/Scripts/WelcomeToUMA.cs

+63-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace UMA
1414
{
15-
15+
[InitializeOnLoad]
1616
public class WelcomeToUMA : EditorWindow
1717
{
1818

@@ -21,6 +21,30 @@ public static WelcomeToUMA Instance
2121
get; set;
2222
}
2323

24+
static WelcomeToUMA()
25+
{
26+
EditorApplication.delayCall += DelayedCall;
27+
}
28+
29+
static void DelayedCall()
30+
{
31+
EditorApplication.update += Update;
32+
}
33+
34+
public static void Update()
35+
{
36+
UMASettings settings = UMASettings.GetOrCreateSettings();
37+
if (settings == null)
38+
{
39+
return;
40+
}
41+
if (settings.showWelcomeToUMA)
42+
{
43+
ShowWindow();
44+
}
45+
EditorApplication.update -= Update;
46+
}
47+
2448
[MenuItem("UMA/Welcome to UMA",false,0)]
2549
public static void ShowWindow()
2650
{
@@ -106,7 +130,7 @@ public void Error(string message)
106130
public bool processing = false;
107131
public bool initialized = false;
108132

109-
133+
public UMASettings initialSettings;
110134

111135

112136
public void OnEnable()
@@ -164,6 +188,7 @@ public void DelayAwake()
164188

165189
//DescriptionStyle.fixedHeight = 48;
166190

191+
initialSettings = UMASettings.GetOrCreateSettings();
167192
currentButton = 0;
168193
DoWelcome();
169194
initialized = true;
@@ -225,6 +250,26 @@ public void DrawNavigation()
225250
if (GUILayout.Button("Basics", GUILayout.Height(40)))
226251
{
227252
ClearLog();
253+
AddText("UMA is a runtime character creation system for Unity3D");
254+
AddText("It relies on a library of indexed items to create characters");
255+
AddText("The library data can be in Resources and/or in Addressable Bundles");
256+
AddSeperator();
257+
AddText("UMA uses a generator to create characters - UMA_GLIB");
258+
AddText("This prefab needs to be in a scene for UMA to work.");
259+
AddText("The generator has settings for texture merging, mesh combining, and more.");
260+
AddText("To get started, use the 'Add an UMA to the current scene' button");
261+
AddText("This will add an editable UMA and generator, if needed");
262+
AddSeperator();
263+
AddText("UMA uses recipes to define meshes, textures, and other data");
264+
AddText("The following are the main base parts of an UMA:");
265+
AddText("SlotData: This contains a mesh part, along with any rig parts needed.");
266+
AddText("OverlayData: This contains texture parts that are colorized and combined to build textures.");
267+
AddText("DNA: This is used to adjust the meshes when built, either bone modifications or blendshapes");
268+
AddText("Recipes: These are used to tied slotdata and overlays together, to build skinned meshes");
269+
AddText("RaceData: This defines a base recipe for the character, what wardrobe slots are available, what DNA converters are used, etc.");
270+
AddSeperator();
271+
AddText("We recommend to watch the videos on youtube for a deeper dive into how UMA works");
272+
AddText("https://www.youtube.com/@SecretAnorak/videos");
228273
// explain about the generator
229274
// about the library
230275
// about races
@@ -282,6 +327,20 @@ public void DrawNavigation()
282327
// Links page has to be done in content window
283328
currentButton = 5;
284329
}
330+
if (initialSettings.showWelcomeToUMA)
331+
{
332+
if (GUILayout.Button("Turn this off!!"))
333+
{
334+
currentButton = 9;
335+
ClearLog();
336+
UMASettings settings = UMASettings.GetOrCreateSettings();
337+
settings.showWelcomeToUMA = false;
338+
EditorUtility.SetDirty(settings);
339+
AddText("The welcome window will no longer show when Unity is opened");
340+
AddText("To view it at any time, you can use the 'UMA/Welcome to UMA' menu item");
341+
AddText("You can re-enable this in the UMA project settings.");
342+
}
343+
}
285344
GUILayout.EndVertical();
286345
GUIHelper.EndInsetArea();
287346
}
@@ -1482,6 +1541,8 @@ private void DoLinksPage()
14821541
ShowLink("Wiki", "UMA Wiki", settings.WikiURL);
14831542
ShowLink("Forum", "UMA Forum", settings.ForumURL);
14841543
ShowLink("Asset Store", "UMA on the Asset Store", settings.AssetStoreURL);
1544+
ShowLink("GitHub", "UMA on GitHub", settings.GithubURL);
1545+
ShowLink("Youtube", "SecretAnorak's UMA Videos", settings.YoutubeURL);
14851546
}
14861547
#endregion
14871548

UMAProject/Assets/UMA/Core/Scripts/UMASettings.cs

+8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public class UMASettings : ScriptableObject
5555
public string WikiURL;
5656
public string ForumURL;
5757
public string AssetStoreURL;
58+
public string GithubURL;
59+
public string YoutubeURL;
5860
[Header("Shader Folder")]
5961
[Tooltip("The folder where the UMA shaders are located, relative to the Assets folder. Usually UMA/Core/ShaderPackages")]
6062
public string ShaderFolder;
@@ -104,6 +106,12 @@ internal static void TestLoad()
104106
UnityEngine.Debug.Log($"LoadAssetAtPath {settings4.GetInstanceID()} loaded in " + stopwatch.ElapsedTicks + " ticks");
105107
}
106108

109+
public static UMASettings GetSettings()
110+
{
111+
var settings = AssetDatabase.LoadAssetAtPath<UMASettings>(customSettingsPath);
112+
return settings;
113+
}
114+
107115
public static UMASettings GetOrCreateSettings()
108116
{
109117
var settings = AssetDatabase.LoadAssetAtPath<UMASettings>(customSettingsPath);

UMAProject/Assets/UMA/InternalDataStore/InGame/Resources/UMASettings.asset

+2
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ MonoBehaviour:
5757
WikiURL: https://github.com/umasteeringgroup/UMA/wiki
5858
ForumURL: https://discussions.unity.com/t/uma-unity-multipurpose-avatar-on-the-asset-store-part-2/1487160
5959
AssetStoreURL: https://assetstore.unity.com/packages/3d/characters/uma-2-35611
60+
GithubURL: https://github.com/umasteeringgroup/UMA
61+
YoutubeURL: https://www.youtube.com/@SecretAnorak/videos
6062
ShaderFolder: UMA/Core/ShaderPackages

0 commit comments

Comments
 (0)