-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify the codebase (#40)
- Loading branch information
1 parent
3f35c03
commit 738f065
Showing
75 changed files
with
10,892 additions
and
9,938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
using UnityEngine; | ||
using Utils; | ||
using View.Overlay; | ||
|
||
namespace Environment { | ||
[DefaultExecutionOrder(1000)] | ||
public class LookAtCamera : MonoBehaviour { | ||
[Inject] [SerializeField] private OverlayChannel _overlay; | ||
private Camera _mainCamera; | ||
|
||
private void Awake() { | ||
_mainCamera = OverlayManager.Camera; | ||
} | ||
|
||
private void LateUpdate() { | ||
if (_overlay.IsReady) { | ||
transform.rotation = | ||
_overlay.CameraManager.MainCamera.transform.rotation; | ||
} | ||
transform.rotation = _mainCamera.transform.rotation; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,51 @@ | ||
using Audio; | ||
using FMODUnity; | ||
using Input; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
|
||
namespace Framework { | ||
// TODO Move to the editor namespace maybe? | ||
#if UNITY_EDITOR | ||
public static class App { | ||
public static GameManager Game; | ||
public static InputManager Input; | ||
public static AudioManager Audio; | ||
public static InputActions Actions; | ||
|
||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] | ||
private static void Bootstrap() { | ||
if (ShouldBootstrap()) { | ||
SceneManager.LoadScene(0, LoadSceneMode.Additive); | ||
private static void BetterBootstrap() { | ||
#if UNITY_EDITOR | ||
if (ShouldSkip()) { | ||
return; | ||
} | ||
#endif | ||
|
||
// Force FMOD initialization to avoid a framerate drop when the first | ||
// sound is played. | ||
_ = RuntimeManager.StudioSystem; | ||
|
||
var app = Object.Instantiate(Resources.Load<GameObject>("App")); | ||
Game = app.GetComponent<GameManager>(); | ||
Input = app.GetComponent<InputManager>(); | ||
Audio = app.GetComponent<AudioManager>(); | ||
Actions = Input.Actions; | ||
|
||
Game.DrivenAwake(); | ||
|
||
Object.DontDestroyOnLoad(app); | ||
} | ||
|
||
private static bool ShouldBootstrap() { | ||
#if UNITY_EDITOR | ||
private static bool ShouldSkip() { | ||
var activeScene = SceneManager.GetActiveScene(); | ||
if (activeScene.buildIndex == 0) { | ||
return false; | ||
} | ||
|
||
var path = activeScene.path; | ||
foreach (var scene in UnityEditor.EditorBuildSettings.scenes) { | ||
if (scene.path == path) { | ||
return true; | ||
return false; | ||
} | ||
} | ||
|
||
return false; | ||
return true; | ||
} | ||
} | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Player.States; | ||
|
||
namespace Framework { | ||
public class GameState : BaseState { | ||
protected GameManager Manager; | ||
|
||
protected virtual void Awake() { | ||
Manager = GetComponent<GameManager>(); | ||
} | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.