Essentials + extra crap
Loadings Startups Movement Camera
This commit is contained in:
1 parent
662f4a1d05
commit
5f5ace1b52
734 files changed
+107323
-1713
No files matched your search
@@ -0,0 +1,40 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using Code.Infrastructure.Camera;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Camera{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "CameraSettingsConfig", menuName = "Configs/Camera/CameraSettings")]
|
||||
public class CameraSettingsConfig : ScriptableObject
|
||||
{
|
||||
public System.Single defaultDistance;
|
||||
public System.Single minDistance;
|
||||
public System.Single maxDistance;
|
||||
public System.Single distanceMovementSpeed;
|
||||
public System.Single rotationSpeed;
|
||||
public System.Single rotationSharpness;
|
||||
public System.Single followSharpness;
|
||||
public System.Single minVerticalAngle;
|
||||
public System.Single maxVerticalAngle;
|
||||
public System.Single defaultVerticalAngle;
|
||||
public System.Single fov;
|
||||
public Code.Infrastructure.Camera.CameraMode cameraMode;
|
||||
public UnityEngine.Vector3 defaultFollowPosition;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c88ecd63428fe3c41ae0fe17948d931e
|
||||
@@ -1,44 +0,0 @@
|
||||
|
||||
// <auto-generated/>
|
||||
using Code.StateMachine;
|
||||
|
||||
using Code.Debug.States;
|
||||
|
||||
using Code.Debug.States;
|
||||
|
||||
namespace Code.Debug
|
||||
{
|
||||
|
||||
public partial class DebugStateMachine : AbstractStateMachine<Code.Debug.DebugStates,Code.Debug.DebugStateMachineContext>
|
||||
{
|
||||
|
||||
public DebugStateMachine()
|
||||
{
|
||||
|
||||
|
||||
var stateFirstState = new FirstState(StateMachineContext);
|
||||
States.Add(stateFirstState.myState, stateFirstState);
|
||||
|
||||
var stateSecondState = new SecondState(StateMachineContext);
|
||||
States.Add(stateSecondState.myState, stateSecondState);
|
||||
|
||||
CurrentBaseState = States[default(Code.Debug.DebugStates)];
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Debug.DebugStates nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class DebugStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Debug.DebugStates, Code.Debug.DebugStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Debug.DebugStates, Code.Debug.DebugStateMachineContext> stateMachine, Code.Debug.DebugStates state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d33c2f17dfcae5e42bd7c3163ef31dc5
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
using Code.Infrastructure.App.States;
|
||||
|
||||
using Code.Infrastructure.App.States;
|
||||
|
||||
using Code.Infrastructure.App.States;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Infrastructure.App
|
||||
{
|
||||
|
||||
public partial class AppStateMachine : AbstractStateMachine<Code.Infrastructure.App.AppStates,Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
public AppStateMachine(Code.Infrastructure.App.AppStateMachineContext context, EventBus.EventBus eventBus) : base(context)
|
||||
{
|
||||
|
||||
var stateBootstrapState = new BootstrapState(StateMachineContext,eventBus);
|
||||
States.Add(stateBootstrapState.myState, stateBootstrapState);
|
||||
|
||||
var stateGameplayState = new GameplayState(StateMachineContext,eventBus);
|
||||
States.Add(stateGameplayState.myState, stateGameplayState);
|
||||
|
||||
var stateMainMenuState = new MainMenuState(StateMachineContext,eventBus);
|
||||
States.Add(stateMainMenuState.myState, stateMainMenuState);
|
||||
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Infrastructure.App.AppStates nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class AppStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext> stateMachine, Code.Infrastructure.App.AppStates state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a6c59a69440bf440a166390c52d5c65
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
public partial class BootstrapState : BaseState<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
protected override void _fireEnterState()
|
||||
{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<Code.Infrastructure.App.States.BootstrapState>>(h => h.EnterState());
|
||||
}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{
|
||||
EventBus.RaiseEvent<IExitStateHandle<Code.Infrastructure.App.States.BootstrapState>>(h => h.ExitState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7addc3cce102d548b48a5714208d030
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
public partial class GameplayState : BaseState<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
protected override void _fireEnterState()
|
||||
{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<Code.Infrastructure.App.States.GameplayState>>(h => h.EnterState());
|
||||
}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{
|
||||
EventBus.RaiseEvent<IExitStateHandle<Code.Infrastructure.App.States.GameplayState>>(h => h.ExitState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea098a6fe9bfd164895db3056277a55d
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
public partial class MainMenuState : BaseState<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
protected override void _fireEnterState()
|
||||
{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<Code.Infrastructure.App.States.MainMenuState>>(h => h.EnterState());
|
||||
}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{
|
||||
EventBus.RaiseEvent<IExitStateHandle<Code.Infrastructure.App.States.MainMenuState>>(h => h.ExitState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99e53d28eb79b4a44bae11561b625594
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
using Code.Infrastructure.Camera.CameraStates;
|
||||
|
||||
using Code.Infrastructure.Camera.CameraStates;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Infrastructure.Camera
|
||||
{
|
||||
|
||||
public partial class CameraStateMachine : AbstractStateMachine<Code.Infrastructure.Camera.CameraMode,Code.Infrastructure.Camera.CameraStateMachineContext>
|
||||
{
|
||||
|
||||
public CameraStateMachine(Code.Infrastructure.Camera.CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context)
|
||||
{
|
||||
|
||||
var stateNoneCameraState = new NoneCameraState(StateMachineContext,eventBus);
|
||||
States.Add(stateNoneCameraState.myState, stateNoneCameraState);
|
||||
|
||||
var stateFirstPersonCameraState = new FirstPersonCameraState(StateMachineContext,eventBus);
|
||||
States.Add(stateFirstPersonCameraState.myState, stateFirstPersonCameraState);
|
||||
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Infrastructure.Camera.CameraMode nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class CameraStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Infrastructure.Camera.CameraMode, Code.Infrastructure.Camera.CameraStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Infrastructure.Camera.CameraMode, Code.Infrastructure.Camera.CameraStateMachineContext> stateMachine, Code.Infrastructure.Camera.CameraMode state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 345063e937b7f8b47a0a476ba4be3cae
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.Camera.CameraStates
|
||||
{
|
||||
public partial class FirstPersonCameraState
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54a17374a26438b4390b3146d07da638
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.Camera.CameraStates
|
||||
{
|
||||
public partial class NoneCameraState
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27063949209437c4cb218fb0225384ed
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Code.Infrastructure.Input;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Camera;
|
||||
|
||||
using UnityEngine;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs
|
||||
{
|
||||
|
||||
public partial class ConfigLocator
|
||||
{
|
||||
partial void LoadConfigs()
|
||||
{
|
||||
SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>("SystemConfigsReferences");
|
||||
|
||||
_multipleConfigReferences.Add(typeof(Code.Infrastructure.SceneLoader.SceneInfoConfig), systemConfigsReferences.SceneInfo);
|
||||
|
||||
_singleConfigReferences.Add(typeof(Code.Infrastructure.Input.InputServiceConfig), systemConfigsReferences.InputService);
|
||||
|
||||
_multipleConfigReferences.Add(typeof(Code.Infrastructure.Camera.CameraSettingsConfig), systemConfigsReferences.CameraSettings);
|
||||
|
||||
_singleConfigReferences.Add(typeof(Code.Infrastructure.Camera.GameCameraConfig), systemConfigsReferences.GameCamera);
|
||||
|
||||
//_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b516a9c04f1000e43936564c38e25cfb
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
using UnityEngine.AddressableAssets;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using System;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Example{
|
||||
[CreateAssetMenu(fileName = "DebugClassConfig", menuName = "Configs/DebugClassConfig")]
|
||||
public class DebugClassConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.AddressableAssets.AssetReference SceneAsset;
|
||||
public Code.Infrastructure.SceneLoader.SceneId SceneId;
|
||||
public System.Int32 _a;
|
||||
public Code.Infrastructure.SceneLoader.SceneLoader _b;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bdfef8d142a3e1438c89da242d2be2f
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Camera{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "GameCameraConfig", menuName = "Configs/Camera/CameraConfig")]
|
||||
public class GameCameraConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.AddressableAssets.AssetReference Camera;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e423434f8bbcbc24e9b8c71840daf6f1
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Configs
|
||||
{
|
||||
public interface IConfigLocator
|
||||
{
|
||||
AssetReference TryGetConfigAssetReference<T>();
|
||||
string TryGetManyConfigAssetReferences<T>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 251b70a9c67d4c108c8a512ed10a3c09
|
||||
timeCreated: 1767125435
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Input{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "InputServiceConfig", menuName = "Configs/InputService")]
|
||||
public class InputServiceConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.InputSystem.InputActionAsset inputActionAsset;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab6d921463750b04aaccb1bf3b2d9608
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine.AddressableAssets;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "SceneInfoConfig", menuName = "Configs/SceneConfig")]
|
||||
public class SceneInfoConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.AddressableAssets.AssetReference SceneAsset;
|
||||
public Code.Infrastructure.SceneLoader.SceneId SceneId;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2d19619e7539f14ea973463204f542c
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
|
||||
using Code.Infrastructure.EventBus;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{
|
||||
public partial class SceneLoader{
|
||||
partial void SetupScenesInfo(){
|
||||
|
||||
|
||||
_scenesActions.Add(SceneId.MainMenu,() => _eventBus.RaiseEvent<IOnMainMenuSceneLoadedHandler>(h=> h.OnMainMenuSceneLoaded()));
|
||||
|
||||
|
||||
_scenesActions.Add(SceneId.Gameplay,() => _eventBus.RaiseEvent<IOnGameplaySceneLoadedHandler>(h=> h.OnGameplaySceneLoaded()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public interface IOnMainMenuSceneLoadedHandler : IGlobalSubscriber
|
||||
{
|
||||
void OnMainMenuSceneLoaded();
|
||||
}
|
||||
|
||||
public interface IOnGameplaySceneLoadedHandler : IGlobalSubscriber
|
||||
{
|
||||
void OnGameplaySceneLoaded();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5687485408450064f98da1725a20926b
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Code.Infrastructure.Input;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Camera;
|
||||
|
||||
using UnityEngine.AddressableAssets;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs{
|
||||
public partial class SystemConfigsReferences
|
||||
{
|
||||
public string SceneInfo;
|
||||
public AssetReference InputService;
|
||||
public string CameraSettings;
|
||||
public AssetReference GameCamera;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e3bd6b172c28ca48b40dd639ef19caf
|
||||
Reference in new issue
Block a user