File tree Expand file tree Collapse file tree 5 files changed +18
-14
lines changed
Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ MonoBehaviour:
139139 m_Script : {fileID: 11500000, guid: 3a698c89160b64541b11228f3098737b, type: 3}
140140 m_Name :
141141 m_EditorClassIdentifier :
142- m_MovementSpeed : 10
142+ m_MovementSpeed : 2.5
143143 m_AnimatorController : {fileID: 214216475}
144144--- !u!1001 &1171686176522753923
145145PrefabInstance :
Original file line number Diff line number Diff line change @@ -2763,11 +2763,6 @@ PrefabInstance:
27632763 propertyPath : m_Name
27642764 value : Player
27652765 objectReference : {fileID: 0}
2766- - target : {fileID: 8083381679980500539, guid: 67db914bd437a69468c6d966454659b0,
2767- type : 3}
2768- propertyPath : m_MovementSpeed
2769- value : 2.5
2770- objectReference : {fileID: 0}
27712766 m_RemovedComponents : []
27722767 m_SourcePrefab : {fileID: 100100000, guid: 67db914bd437a69468c6d966454659b0, type: 3}
27732768--- !u!1001 &2096555481
Original file line number Diff line number Diff line change 11using UnityEngine ;
2+ using UnityEngine . SceneManagement ;
23using UnityEngine . AddressableAssets ;
34
45public class GameManager : MonoBehaviour
@@ -15,12 +16,13 @@ public void ExitGame()
1516
1617 public static void LoadNextLevel ( )
1718 {
18- //TODO: Show old workflow
19+ // We are going to be using the Addressables API to manage our scene loading and unloading, the equivalent way on the UnityEngine.SceneManagement API is:
20+ // SceneManager.LoadSceneAsync("LoadingScene", LoadSceneMode.Single);
1921
22+ // Scene loaded in Single mode, the previously loaded scenes will be disposed by the Addressables.
2023 Addressables . LoadSceneAsync ( "LoadingScene" , UnityEngine . SceneManagement . LoadSceneMode . Single , true ) ;
2124 }
2225
23- /// <summary>
2426 public static void LevelCompleted ( )
2527 {
2628 s_CurrentLevel ++ ;
Original file line number Diff line number Diff line change 55
66public class Loading : MonoBehaviour
77{
8- private bool m_LoadingComplete = false ;
8+ // private bool m_LoadingComplete = false;
99
1010 [ SerializeField ]
1111 private Slider m_LoadingSlider ;
@@ -14,7 +14,7 @@ public class Loading : MonoBehaviour
1414 private GameObject m_PlayButton ;
1515
1616 // TODO: Maybe just have it inside the Start method and not class-wide
17- AsyncOperationHandle m_SceneHandle ;
17+ private AsyncOperationHandle m_SceneHandle ;
1818
1919 // Start is called before the first frame update
2020 void OnEnable ( )
@@ -49,6 +49,4 @@ private void Update()
4949 m_LoadingSlider . value = m_SceneHandle . PercentComplete ;
5050 }
5151 }
52-
53- //Make the oncomplete
5452}
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ public class PlayerConfigurator : MonoBehaviour
77 [ SerializeField ]
88 private Transform m_HatAnchor ;
99
10- // Start is called before the first frame update
1110 void Start ( )
1211 {
1312 //TODO: Remove this random stuff, just for testing atm
@@ -17,13 +16,23 @@ void Start()
1716 // TODO: Change the string parameter
1817 public void SetHat ( string hatKey )
1918 {
19+ // We are using the InstantiateAsync function on the Addressables API, the non-Addressables way
20+ // looks something like the following line, however, this version is not Asynchronous
21+ // GameObject.Instantiate(prefabToInstantiate);
22+
2023 Addressables . InstantiateAsync ( hatKey , m_HatAnchor , false ) . Completed += OnHatInstantiated ;
2124 }
2225
23- // TOASK: Where to unsubscribe
26+ private void OnDisable ( )
27+ {
28+ // TODO: Unsubscribe
29+ }
2430
31+ // TOASK: Where to unsubscribe
2532 private void OnHatInstantiated ( AsyncOperationHandle < GameObject > obj )
2633 {
2734 Debug . Log ( "Hat Instantiated" ) ;
35+
36+
2837 }
2938}
You can’t perform that action at this time.
0 commit comments