Add automatic Rive asset refresh workflow

This commit is contained in:
pelpanagiotis
2026-09-20 10:01:38 +03:00
parent d04ff998cb
commit c674d76549
45 changed files with 226275 additions and 248678 deletions
+37 -5
View File
@@ -45,6 +45,7 @@ namespace ProceduralEditor
SetupPanel(faceMaterial);
SetupFog();
SetupPostProcessVolume();
RemoveLegacyLogo();
SetupFadeCanvas();
EditorSceneManager.MarkSceneDirty(scene);
@@ -178,12 +179,46 @@ namespace ProceduralEditor
RenderSettings.fog = false;
}
static void RemoveLegacyLogo()
{
var legacyLogo = GameObject.Find("NetCode Logo");
if (legacyLogo != null)
Object.DestroyImmediate(legacyLogo);
}
static void SetupFadeCanvas()
{
var existing = GameObject.Find("Fade Canvas");
if (existing != null) Object.DestroyImmediate(existing);
if (existing != null)
{
existing.SetActive(true);
existing.transform.localScale = Vector3.one;
var existingImage = existing.transform.Find("Fade Image");
if (existingImage != null)
{
existingImage.gameObject.SetActive(true);
var existingFadeIn = existingImage.GetComponent<MenuFadeIn>();
if (existingFadeIn == null)
existingFadeIn = existingImage.gameObject.AddComponent<MenuFadeIn>();
existingFadeIn.delay = 2.5f;
existingFadeIn.duration = 3.5f;
existingFadeIn.enabled = true;
var existingGroup = existingImage.GetComponent<CanvasGroup>();
if (existingGroup != null)
{
existingGroup.alpha = 1f;
existingGroup.blocksRaycasts = true;
existingGroup.interactable = true;
}
return;
}
}
var canvasGo = new GameObject("Fade Canvas", typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster));
canvasGo.transform.localScale = Vector3.one;
var canvas = canvasGo.GetComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
// Ensure fade canvas draws on top of other UI canvases
@@ -204,11 +239,8 @@ namespace ProceduralEditor
rect.offsetMax = Vector2.zero;
var fadeIn = imageGo.AddComponent<MenuFadeIn>();
fadeIn.delay = 0.3f;
fadeIn.delay = 2.5f;
fadeIn.duration = 3.5f;
// Disable automatic fade-on-start so the debug toggle controls opacity predictably.
// If you prefer the automatic fade, remove this line.
fadeIn.enabled = false;
// Make sure the image initially is fully opaque so the menu starts covered by the backdrop
var initColor = image.color;