Migrate shaders to URP and add loading screen
Reworks multiple shaders and materials for URP compatibility and adds a Loading screen/scene and a few model imports. Key changes: - Converted ProBuilder standard vertex-color shader and several particle/surface shaders to URP HLSL passes (UniversalForward, ShadowCaster, Depth, DepthNormals) preserving base texture * tint * vertex color, normal map and PBR parameters. - Updated particle SurfaceShader_VC to a URP forward pass and simplified lighting to use URP shader library helpers. - Updated materials (landMark, tile) to point to project textures, adjust keywords/flags (e.g. XRMotionVectorsPass, disable ShadowCaster for one), tweak tiling and base color values. - Added a Loading screen UI (UXML, USS) and LoadingScreenController.cs plus a new Loading scene and scene metadata. - Imported new FBX assets (T-Pose, Untitled) and updated Editor build settings / project settings to include the new Loading scene. These changes migrate rendering code to the Universal Render Pipeline and add a basic loading UI/scene, while updating materials and project settings accordingly.
This commit is contained in:
8
Assets/Game/Menus/LoadingScreen.meta
Normal file
8
Assets/Game/Menus/LoadingScreen.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d941a2d26357b4d45a9b8caa347d5562
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
47
Assets/Game/Menus/LoadingScreen/LoadingScreen.uss
Normal file
47
Assets/Game/Menus/LoadingScreen/LoadingScreen.uss
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Contenedor Principal responsivo */
|
||||
.loading-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex-grow: 1;
|
||||
background-color: #000000;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Texto de Carga */
|
||||
.loading-text {
|
||||
font-size: 50px;
|
||||
color: #ffffff;
|
||||
-unity-font-style: bold;
|
||||
margin-right: 40px;
|
||||
margin-bottom: 40px;
|
||||
|
||||
/* 1. Hacemos la caja más ancha para que quepa "CARGANDO..." con la fuente Komika */
|
||||
width: 350px;
|
||||
|
||||
/* 2. Anclamos el texto a la izquierda de la caja */
|
||||
-unity-text-align: middle-left;
|
||||
|
||||
/* 3. Evitamos estrictamente que el texto salte a la siguiente línea */
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Contenedor de la Nave */
|
||||
.spaceship-icon {
|
||||
/* 1. Quitamos position: absolute para que respete el flujo y baje a la esquina */
|
||||
position: relative;
|
||||
|
||||
/* 2. Tamaño ajustado */
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
|
||||
/* 3. Márgenes para alinearla con el texto (mismo margin-left que el texto) */
|
||||
margin-left: 40px;
|
||||
|
||||
/* 4. Un pequeño margen abajo para que no pegue con las letras */
|
||||
margin-bottom: -20px;
|
||||
|
||||
/* Ajuste de imagen */
|
||||
-unity-background-scale-mode: scale-to-fit;
|
||||
}
|
||||
12
Assets/Game/Menus/LoadingScreen/LoadingScreen.uss.meta
Normal file
12
Assets/Game/Menus/LoadingScreen/LoadingScreen.uss.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2338a47a6d4bdf04fb16da5ab852dee3
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
unsupportedSelectorAction: 0
|
||||
7
Assets/Game/Menus/LoadingScreen/LoadingScreen.uxml
Normal file
7
Assets/Game/Menus/LoadingScreen/LoadingScreen.uxml
Normal file
@@ -0,0 +1,7 @@
|
||||
<ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||
<Style src="project://database/Assets/Game/Menus/LoadingScreen/LoadingScreen.uss?fileID=7433441132597879392&guid=2338a47a6d4bdf04fb16da5ab852dee3&type=3#LoadingScreen"/>
|
||||
<ui:VisualElement name="Container" class="loading-container" style="aspect-ratio: 1.777778;">
|
||||
<ui:VisualElement name="Spaceship" class="spaceship-icon"/>
|
||||
<ui:Label text="Cargando" name="LoadingText" class="loading-text" style="-unity-font-definition: url("project://database/Assets/Game/Menus/Fonts/KOMIKAX_.ttf?fileID=12800000&guid=afbd8b3e208400c4ebf47631612ef61f&type=3#KOMIKAX_");"/>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
10
Assets/Game/Menus/LoadingScreen/LoadingScreen.uxml.meta
Normal file
10
Assets/Game/Menus/LoadingScreen/LoadingScreen.uxml.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 574e334a49fbd6945b59354aed996919
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
80
Assets/Game/Menus/LoadingScreen/LoadingScreenController.cs
Normal file
80
Assets/Game/Menus/LoadingScreen/LoadingScreenController.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System.Collections;
|
||||
|
||||
public class LoadingScreenController : MonoBehaviour
|
||||
{
|
||||
private UIDocument _doc;
|
||||
private Label _loadingText;
|
||||
private VisualElement _spaceship;
|
||||
|
||||
private int _dotCount = 0;
|
||||
private float _time = 0f;
|
||||
|
||||
[Header("Configuración de Carga")]
|
||||
public string sceneToLoad = "SampleScene";
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_doc = GetComponent<UIDocument>();
|
||||
var root = _doc.rootVisualElement;
|
||||
|
||||
_loadingText = root.Q<Label>("LoadingText");
|
||||
_spaceship = root.Q<VisualElement>("Spaceship");
|
||||
|
||||
// 1. Animación del texto: Se ejecuta cada 400 milisegundos
|
||||
root.schedule.Execute(UpdateLoadingText).Every(400);
|
||||
|
||||
// 2. Animación loca de la nave: Se ejecuta cada 20 milisegundos para fluidez
|
||||
root.schedule.Execute(AnimateSpaceship).Every(20);
|
||||
|
||||
// 3. Iniciar la carga de la escena en segundo plano
|
||||
StartCoroutine(LoadSceneAsync());
|
||||
}
|
||||
|
||||
private void UpdateLoadingText()
|
||||
{
|
||||
// Alterna entre 0 y 3 puntos
|
||||
_dotCount = (_dotCount + 1) % 4;
|
||||
_loadingText.text = "Cargando" + new string('.', _dotCount);
|
||||
}
|
||||
|
||||
private void AnimateSpaceship()
|
||||
{
|
||||
if (_spaceship == null) return;
|
||||
|
||||
_time += 0.1f;
|
||||
|
||||
// Efecto "Rabbid": vibración y rotación errática usando Seno y Coseno
|
||||
float offsetX = Mathf.Sin(_time * 12f) * 8f;
|
||||
float offsetY = Mathf.Cos(_time * 15f) * 6f;
|
||||
float rotation = Mathf.Sin(_time * 20f) * 3f;
|
||||
|
||||
_spaceship.style.translate = new Translate(offsetX, offsetY, 0);
|
||||
_spaceship.style.rotate = new Rotate(new Angle(rotation, AngleUnit.Degree));
|
||||
}
|
||||
|
||||
private IEnumerator LoadSceneAsync()
|
||||
{
|
||||
// Pequeña pausa opcional para que la pantalla no parpadee si la escena carga muy rápido
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneToLoad);
|
||||
|
||||
// La escena no cambia automáticamente hasta que nosotros lo indiquemos
|
||||
asyncLoad.allowSceneActivation = false;
|
||||
|
||||
// Espera hasta que Unity haya cargado el 90% (el 10% restante es la activación)
|
||||
while (asyncLoad.progress < 0.9f)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// Pequeña pausa para que la animación sea visible aunque la escena cargue muy rápido
|
||||
yield return new WaitForSeconds(0.8f);
|
||||
|
||||
// Ahora sí, activa la escena
|
||||
asyncLoad.allowSceneActivation = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62ff0d03d5ac484428d8223d73a8b8b2
|
||||
@@ -1 +1,2 @@
|
||||
@import url("project://database/Assets/UI Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss");
|
||||
|
||||
@import url("MainMenu.uss");
|
||||
|
||||
@@ -47,8 +47,8 @@ public class MainMenuController : MonoBehaviour
|
||||
private void OnPlayClicked()
|
||||
{
|
||||
PlayClickSound();
|
||||
Debug.Log("¡BWAAAH! Iniciando juego...");
|
||||
// SceneManager.LoadScene("GameScene");
|
||||
Debug.Log("Cargando SampleScene...");
|
||||
SceneManager.LoadScene("Loading");
|
||||
}
|
||||
|
||||
private void OnSettingsClicked()
|
||||
|
||||
Reference in New Issue
Block a user