Fixes in 1.0 SBB BT; add InternetVolumeLogger Prefab; add FadeOut to LevelManager
This commit is contained in:
		
							parent
							
								
									768bd1f312
								
							
						
					
					
						commit
						6f7e922a4c
					
				@ -156,6 +156,7 @@ Tree("10_SBB_Zugabteil_Szenenwahl_Selection") {
 | 
			
		||||
                        // Story A + B besucht
 | 
			
		||||
                        BTC.StoryBVisited()
 | 
			
		||||
                        // --- Story Ende ---
 | 
			
		||||
                        BTC.Hide("MediaPlayer.VIDEOS.IntroFidle1")
 | 
			
		||||
                        BTC.Run("MediaPlayer.VIDEOS.StoryEndeF1")
 | 
			
		||||
                        BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black")
 | 
			
		||||
                        BTC.Run("LoadScene.NEXT.00Menu")
 | 
			
		||||
@ -165,6 +166,7 @@ Tree("10_SBB_Zugabteil_Szenenwahl_Selection") {
 | 
			
		||||
                        // Story A besucht
 | 
			
		||||
                        // Story B nicht besucht
 | 
			
		||||
                        // --- Repetition Intro B ---
 | 
			
		||||
                        BTC.Hide("MediaPlayer.VIDEOS.IntroFidle1")
 | 
			
		||||
                        BTC.Run("MediaPlayer.VIDEOS.RepetitionIntroBF1")
 | 
			
		||||
                        BTC.Run("MediaPlayer.VIDEOS.RepetitionIntroBFi_2")
 | 
			
		||||
                        RunTree("10_SBB_Zugabteil_Szenenwahl")
 | 
			
		||||
@ -179,6 +181,7 @@ Tree("10_SBB_Zugabteil_Szenenwahl_Selection") {
 | 
			
		||||
                // Story B besucht
 | 
			
		||||
                // Story A nicht besucht
 | 
			
		||||
                // --- Repetition Intro A ---
 | 
			
		||||
                BTC.Hide("MediaPlayer.VIDEOS.IntroFidle1")
 | 
			
		||||
                BTC.Run("MediaPlayer.VIDEOS.RepetitionIntroAF1")
 | 
			
		||||
                BTC.Run("MediaPlayer.VIDEOS.RepetitionIntroAFi_2")
 | 
			
		||||
                RunTree("10_SBB_Zugabteil_Szenenwahl")
 | 
			
		||||
 | 
			
		||||
@ -91,6 +91,7 @@ public class NamedAVProMediaPlayer : ComponentHandler
 | 
			
		||||
                if (_mediaPlayer.Control.IsFinished())
 | 
			
		||||
                {
 | 
			
		||||
                    _mediaPlayer.CloseMedia();
 | 
			
		||||
                    _mediaPlayer.ForceDispose();
 | 
			
		||||
                    Task.SetSucceeded();
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
@ -127,6 +128,7 @@ public class NamedAVProMediaPlayer : ComponentHandler
 | 
			
		||||
                    {
 | 
			
		||||
                        _mediaPlayer.Stop();
 | 
			
		||||
                        _mediaPlayer.CloseMedia();
 | 
			
		||||
                        _mediaPlayer.ForceDispose();
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										50
									
								
								Viagg-io/Assets/Prefabs/InternetVolumeLogger.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								Viagg-io/Assets/Prefabs/InternetVolumeLogger.prefab
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
%YAML 1.1
 | 
			
		||||
%TAG !u! tag:unity3d.com,2011:
 | 
			
		||||
--- !u!1 &3384523045912799344
 | 
			
		||||
GameObject:
 | 
			
		||||
  m_ObjectHideFlags: 0
 | 
			
		||||
  m_CorrespondingSourceObject: {fileID: 0}
 | 
			
		||||
  m_PrefabInstance: {fileID: 0}
 | 
			
		||||
  m_PrefabAsset: {fileID: 0}
 | 
			
		||||
  serializedVersion: 6
 | 
			
		||||
  m_Component:
 | 
			
		||||
  - component: {fileID: 5113645105102680181}
 | 
			
		||||
  - component: {fileID: 5942046805704443072}
 | 
			
		||||
  m_Layer: 0
 | 
			
		||||
  m_Name: InternetVolumeLogger
 | 
			
		||||
  m_TagString: Untagged
 | 
			
		||||
  m_Icon: {fileID: 0}
 | 
			
		||||
  m_NavMeshLayer: 0
 | 
			
		||||
  m_StaticEditorFlags: 0
 | 
			
		||||
  m_IsActive: 1
 | 
			
		||||
--- !u!4 &5113645105102680181
 | 
			
		||||
Transform:
 | 
			
		||||
  m_ObjectHideFlags: 0
 | 
			
		||||
  m_CorrespondingSourceObject: {fileID: 0}
 | 
			
		||||
  m_PrefabInstance: {fileID: 0}
 | 
			
		||||
  m_PrefabAsset: {fileID: 0}
 | 
			
		||||
  m_GameObject: {fileID: 3384523045912799344}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
 | 
			
		||||
  m_LocalPosition: {x: -1.1034061, y: 0.7802242, z: 0.38190326}
 | 
			
		||||
  m_LocalScale: {x: 1, y: 1, z: 1}
 | 
			
		||||
  m_ConstrainProportionsScale: 0
 | 
			
		||||
  m_Children: []
 | 
			
		||||
  m_Father: {fileID: 0}
 | 
			
		||||
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 | 
			
		||||
--- !u!114 &5942046805704443072
 | 
			
		||||
MonoBehaviour:
 | 
			
		||||
  m_ObjectHideFlags: 0
 | 
			
		||||
  m_CorrespondingSourceObject: {fileID: 0}
 | 
			
		||||
  m_PrefabInstance: {fileID: 0}
 | 
			
		||||
  m_PrefabAsset: {fileID: 0}
 | 
			
		||||
  m_GameObject: {fileID: 3384523045912799344}
 | 
			
		||||
  m_Enabled: 1
 | 
			
		||||
  m_EditorHideFlags: 0
 | 
			
		||||
  m_Script: {fileID: 11500000, guid: f56b22124715447a2bf156c1628f37de, type: 3}
 | 
			
		||||
  m_Name: 
 | 
			
		||||
  m_EditorClassIdentifier: 
 | 
			
		||||
  logInterval: 5
 | 
			
		||||
  logFileName: internet_volume_log.txt
 | 
			
		||||
  enableLogging: 1
 | 
			
		||||
  showInConsole: 1
 | 
			
		||||
							
								
								
									
										7
									
								
								Viagg-io/Assets/Prefabs/InternetVolumeLogger.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Viagg-io/Assets/Prefabs/InternetVolumeLogger.prefab.meta
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
fileFormatVersion: 2
 | 
			
		||||
guid: 9a9ef559475fc4d19b0bb4c19950975b
 | 
			
		||||
PrefabImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -16,11 +16,18 @@ public class LevelManager : MonoBehaviour
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [SerializeField]
 | 
			
		||||
    private string jumpPointGrottoEssen;
 | 
			
		||||
    string jumpPointGrottoEssen;
 | 
			
		||||
 | 
			
		||||
    [SerializeField]
 | 
			
		||||
    private string jumpPointGrottoKueche;
 | 
			
		||||
    string jumpPointGrottoKueche;
 | 
			
		||||
 | 
			
		||||
    [SerializeField]
 | 
			
		||||
    float fadeDuration = 3f;
 | 
			
		||||
    
 | 
			
		||||
    [SerializeField]
 | 
			
		||||
    GameObject fadeScreenObj;
 | 
			
		||||
 | 
			
		||||
    private Material _fadeMaterial;
 | 
			
		||||
 | 
			
		||||
    // A list of LevelEntry objects that can be filled in the inspector
 | 
			
		||||
    public List<LevelEntry> levels = new List<LevelEntry>();
 | 
			
		||||
@ -47,6 +54,9 @@ public class LevelManager : MonoBehaviour
 | 
			
		||||
                entry.levelButton.onClick.AddListener(() => SetEntryLevel(goToJumpPoint));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Renderer _renderer = fadeScreenObj?.GetComponent<Renderer>();
 | 
			
		||||
        _fadeMaterial = _renderer?.sharedMaterial;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // This method is called when a button is clicked, and loads the given scene by name
 | 
			
		||||
@ -57,6 +67,8 @@ public class LevelManager : MonoBehaviour
 | 
			
		||||
 | 
			
		||||
    IEnumerator LoadAsyncScene(string sceneName)
 | 
			
		||||
    {
 | 
			
		||||
        yield return StartCoroutine(FadeOut());
 | 
			
		||||
 | 
			
		||||
        AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneName);
 | 
			
		||||
 | 
			
		||||
        // Wait until the asynchronous scene fully loads
 | 
			
		||||
@ -66,6 +78,26 @@ public class LevelManager : MonoBehaviour
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    IEnumerator FadeOut()
 | 
			
		||||
    {
 | 
			
		||||
        fadeScreenObj.SetActive(true);
 | 
			
		||||
        float elapsedTime = 0f;
 | 
			
		||||
        Color color = _fadeMaterial.color;
 | 
			
		||||
 | 
			
		||||
        while (elapsedTime < fadeDuration)
 | 
			
		||||
        {
 | 
			
		||||
            elapsedTime += Time.deltaTime;
 | 
			
		||||
            float alpha = Mathf.Lerp(0f, 1f, elapsedTime / fadeDuration);
 | 
			
		||||
            color.a = alpha;
 | 
			
		||||
            _fadeMaterial.color = color;
 | 
			
		||||
            yield return null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Ensure the final alpha value is set
 | 
			
		||||
        color.a = 1f;
 | 
			
		||||
        _fadeMaterial.color = color;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void SetEntryLevel(string entryPoint)
 | 
			
		||||
    {
 | 
			
		||||
        if (string.IsNullOrEmpty(entryPoint))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user