Skip to content

Commit e6d2656

Browse files
committed
Comments Added to some scripts
1 parent 4117a5c commit e6d2656

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

Assets/Prefabs/Player.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
145145
PrefabInstance:

Assets/Scenes/Level_00.unity

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff 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

Assets/Scripts/GameManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using UnityEngine;
2+
using UnityEngine.SceneManagement;
23
using UnityEngine.AddressableAssets;
34

45
public 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++;

Assets/Scripts/Loading.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public 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
}

Assets/Scripts/PlayerConfigurator.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)