Теперь камера - это стейт-машина

This commit is contained in:
ThomasCharester authored and Loša Ceviel committed 2025-10-28 22:11:46 +03:00
1 parent db541fed8a
commit 4549617275
31 files changed
+1145 -210

No files matched your search

@@ -1,4 +1,6 @@
using Code.App.StateMachine; using Code.App.StateMachine;
using Code.Gameplay.Camera;
using Code.Gameplay.Player;
using Code.Input; using Code.Input;
using Code.Scenes; using Code.Scenes;
using Code.StateMachine; using Code.StateMachine;
@@ -16,8 +18,13 @@ namespace Code.App.AppStates
public override void EnterState() public override void EnterState()
{ {
Context.SceneLoaderService.LoadScene((int)SceneIds.Gameplay, SceneLoaded); Context.SceneLoaderService.LoadScene((int)SceneIds.MovementDev, SceneLoaded);
Context.InputService.EnableMap(ActionMappings.Gameplay); Context.InputService.EnableMap(ActionMappings.Gameplay);
Context.UIService.LoadingScreen.Show();
Context.UIService.SwitchPanelTo(UIPanel.Gameplay);
Context.CameraStateMachine.SwitchState(CameraMode.FirstPerson);
} }
private void SceneLoaded() private void SceneLoaded()
@@ -1,4 +1,5 @@
using Code.App.StateMachine; using Code.App.StateMachine;
using Code.Gameplay.Camera;
using Code.Input; using Code.Input;
using Code.Scenes; using Code.Scenes;
using Code.StateMachine; using Code.StateMachine;
@@ -14,11 +15,18 @@ namespace Code.App.AppStates
{ {
Context.SceneLoaderService.LoadScene((int)SceneIds.MainMenu, SceneLoaded); Context.SceneLoaderService.LoadScene((int)SceneIds.MainMenu, SceneLoaded);
Context.InputService.EnableMap(ActionMappings.MainMenu); Context.InputService.EnableMap(ActionMappings.MainMenu);
Context.UIService.LoadingScreen.Show();
Context.UIService.SwitchPanelTo(UIPanel.MainMenu);
((MainMenuPanel)Context.UIService.CurrentPanel).startButton.onClick.AddListener(StartGame);
((MainMenuPanel)Context.UIService.CurrentPanel).exitButton.onClick.AddListener(ExitGame);
Context.CameraStateMachine.SwitchState(CameraMode.Static);
} }
private void SceneLoaded() private void SceneLoaded()
{ {
//Context.UIService.LoadingScreen.Hide(); Context.UIService.LoadingScreen.Hide();
base.EnterState(); base.EnterState();
} }
@@ -1,5 +1,6 @@
using Code.App.StateMachine; using Code.App.StateMachine;
using Code.Configs; using Code.Configs;
using Code.Gameplay.Camera;
using Code.Gameplay.Character.Camera; using Code.Gameplay.Character.Camera;
using Code.Input; using Code.Input;
using Code.Scenes; using Code.Scenes;
@@ -32,9 +33,13 @@ namespace Code.App
private void InitializeCamera(ContainerBuilder containerBuilder, IStaticDataService staticDataService) private void InitializeCamera(ContainerBuilder containerBuilder, IStaticDataService staticDataService)
{ {
CameraService cameraService = Instantiate(staticDataService.CameraConfig.cameraPrefab); // CameraService cameraService = Instantiate(staticDataService.CameraConfig.cameraPrefab);
containerBuilder.AddSingleton(cameraService); // containerBuilder.AddSingleton(cameraService);
DontDestroyOnLoad(cameraService); // DontDestroyOnLoad(cameraService);
Camera camera = Instantiate(staticDataService.CameraConfig.cameraPrefab2);
DontDestroyOnLoad(camera);
containerBuilder.AddSingleton(camera);
} }
private void InstallInfrastructureUnit(ContainerBuilder containerBuilder, IStaticDataService staticDataService) private void InstallInfrastructureUnit(ContainerBuilder containerBuilder, IStaticDataService staticDataService)
@@ -46,6 +51,7 @@ namespace Code.App
containerBuilder.AddSingleton(infrastructureUnit.GetComponent<ICoroutineRunner>(), containerBuilder.AddSingleton(infrastructureUnit.GetComponent<ICoroutineRunner>(),
typeof(ICoroutineRunner)); typeof(ICoroutineRunner));
containerBuilder.AddSingleton(infrastructureUnit.AddComponent<AppStateMachine>()); containerBuilder.AddSingleton(infrastructureUnit.AddComponent<AppStateMachine>());
containerBuilder.AddSingleton(infrastructureUnit.AddComponent<CameraStateMachine>());
} }
private void InstallStaticData(ContainerBuilder containerBuilder, out IStaticDataService staticDataService) private void InstallStaticData(ContainerBuilder containerBuilder, out IStaticDataService staticDataService)
@@ -67,6 +73,11 @@ namespace Code.App
AttributeInjector.Inject(appStateMachine.StateMachineContext, container); AttributeInjector.Inject(appStateMachine.StateMachineContext, container);
CameraStateMachine cameraStateMachine = container.Resolve<CameraStateMachine>();
AttributeInjector.Inject(cameraStateMachine.StateMachineContext, container);
cameraStateMachine.Initialize();
// TODO: поменяно для теста // TODO: поменяно для теста
appStateMachine appStateMachine
.SwitchState(AppState.MovementDev); .SwitchState(AppState.MovementDev);
@@ -1,3 +1,4 @@
using Code.Gameplay.Camera;
using Code.Input; using Code.Input;
using Code.Scenes; using Code.Scenes;
using Reflex.Attributes; using Reflex.Attributes;
@@ -8,5 +9,8 @@ namespace Code.App.StateMachine
{ {
[Inject] public ISceneLoaderService SceneLoaderService; [Inject] public ISceneLoaderService SceneLoaderService;
[Inject] public IInputService InputService; [Inject] public IInputService InputService;
[Inject] public IUIService UIService;
[Inject] public AppStateMachine StateMachine;
[Inject] public CameraStateMachine CameraStateMachine;
} }
} }
@@ -1,3 +1,4 @@
using Code.Gameplay.Camera;
using Code.Gameplay.Character.Camera; using Code.Gameplay.Character.Camera;
using Code.Gameplay.Character.Core; using Code.Gameplay.Character.Core;
using UnityEngine; using UnityEngine;
@@ -37,5 +38,6 @@ namespace Code.Configs
public Vector3 defaultFollowPosition = Vector3.zero; public Vector3 defaultFollowPosition = Vector3.zero;
public CameraService cameraPrefab; public CameraService cameraPrefab;
public Camera cameraPrefab2;
} }
} }
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0fae52abe6b44ad5bdd6e67876fe940a
timeCreated: 1761671702
@@ -1,4 +1,4 @@
namespace Code.Gameplay.Character.Core namespace Code.Gameplay.Camera
{ {
/* /*
* Перечисление режимов работы камеры * Перечисление режимов работы камеры
@@ -0,0 +1,23 @@
using Code.Configs;
using Code.Gameplay.Camera.CameraStates;
using Code.StateMachine;
namespace Code.Gameplay.Camera
{
public class CameraStateMachine : AbstractStateMachine<CameraMode, CameraStateMachineContext>
{
// Текущий режим работы камеры
public override void Initialize()
{
States.Add(CameraMode.Static, new StaticState(StateMachineContext));
States.Add(CameraMode.FirstPerson, new FirstPersonState(StateMachineContext));
States.Add(CameraMode.ThirdPerson, new ThirdPersonState(StateMachineContext));
}
protected override bool CheckTransitionAllowed(CameraMode nextState) => true;
protected override void ResetAllowedTransitions()
{ }
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b220b02510c34ea08257cc951d949fd7
timeCreated: 1761671720
@@ -0,0 +1,13 @@
using Code.Configs;
using Code.Input;
using Reflex.Attributes;
namespace Code.Gameplay.Camera
{
public class CameraStateMachineContext
{
[Inject] public UnityEngine.Camera Camera;
[Inject] public CameraConfig Config;
[Inject] public IInputService InputService;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4f18a74bdb8947bebec56115659e5af3
timeCreated: 1761671752
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d7399e433dff42a185f62d79b546b059
timeCreated: 1761671908
@@ -0,0 +1,153 @@
using System;
using Code.Input;
using Code.StateMachine;
using UnityEngine;
namespace Code.Gameplay.Camera.CameraStates
{
public class FirstPersonState : BaseState<CameraStateMachineContext>
{
// Параметры загружаются из CameraConfig
private float
_defaultDistance,
_minDistance,
_maxDistance,
_distanceMovementSpeed,
_rotationSpeed,
_rotationSharpness,
_followSharpness,
_minVerticalAngle,
_maxVerticalAngle,
_defaultVerticalAngle;
// Трансформ объекта, за которым следует камера (для 1st-person: уровень глаз)
private Transform _followTransform;
// Позиция следования: текущая сглаженная позиция и горизонтальное направление камеры
private Vector3 _currentFollowPosition;
// Fallback-позиция для режимов без цели (например, MainMenu)
private Vector3 _defaultFollowPosition;
// Целевой вертикальный угол камеры (наклон вверх/вниз)
private float _targetVerticalAngle;
// Текущая и целевая дистанция камеры от цели
private float _currentDistance, _targetDistance;
// Исходные значения дистанции для восстановления после FirstPerson режима
private float _originalDefaultDistance, _originalMinDistance, _originalMaxDistance;
// Горизонтальное направление камеры (проекция forward на плоскость)
public Vector3 PlanarDirection { get; private set; }
private IInputService _inputService;
private UnityEngine.Camera _camera;
public FirstPersonState(CameraStateMachineContext context) : base(context)
{
_inputService = context.InputService;
// Загрузка значений из конфига
_defaultDistance = context.Config.defaultDistance;
_minDistance = context.Config.minDistance;
_maxDistance = context.Config.maxDistance;
_distanceMovementSpeed = context.Config.distanceMovementSpeed;
_rotationSpeed = context.Config.rotationSpeed;
_rotationSharpness = context.Config.rotationSharpness;
_followSharpness = context.Config.followSharpness;
_minVerticalAngle = context.Config.minVerticalAngle;
_maxVerticalAngle = context.Config.maxVerticalAngle;
_defaultVerticalAngle = context.Config.defaultVerticalAngle;
_defaultFollowPosition = context.Config.defaultFollowPosition;
// Валидация значений (на случай ручного редактирования конфига)
_defaultDistance = Mathf.Clamp(_defaultDistance, _minDistance, _maxDistance);
_defaultVerticalAngle = Mathf.Clamp(_defaultVerticalAngle, _minVerticalAngle, _maxVerticalAngle);
// Сохраняем оригинальные значения для восстановления
_originalDefaultDistance = _defaultDistance;
_originalMinDistance = _minDistance;
_originalMaxDistance = _maxDistance;
// Инициализация состояния камеры
_currentDistance = _defaultDistance;
_targetDistance = _currentDistance;
_targetVerticalAngle = _defaultVerticalAngle;
PlanarDirection = Vector3.forward; // Начальное направление - вперед по оси Z
_currentFollowPosition = _defaultFollowPosition;
}
public override void EnterState()
{
// В FirstPerson режиме дистанция всегда равна 0
_minDistance = 0f;
_maxDistance = 0f;
_defaultDistance = 0f;
_targetDistance = 0f;
_currentDistance = 0f;
_camera = Context.Camera;
}
public override void LateTick()
{
UpdateWithInput(Time.deltaTime,_inputService.ZoomInput, _inputService.LookInput);
}
// Обработка вращения камеры на основе пользовательского ввода
private void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion targetRotation)
{
// Вращение вокруг вертикальной оси (горизонтальный поворот)
var rotationFromInput = Quaternion.Euler(_followTransform.up * (rotationInput.x * _rotationSpeed));
PlanarDirection = rotationFromInput * PlanarDirection;
var planarRotation = Quaternion.LookRotation(PlanarDirection, _followTransform.up);
// Вращение вокруг горизонтальной оси (вертикальный наклон)
_targetVerticalAngle -= rotationInput.y * _rotationSpeed;
_targetVerticalAngle = Math.Clamp(_targetVerticalAngle, _minVerticalAngle, _maxVerticalAngle);
var verticalRotation = Quaternion.Euler(_targetVerticalAngle, 0, 0);
// Интерполяция к целевому вращению для плавности
targetRotation = Quaternion.Slerp(_camera.transform.rotation, planarRotation * verticalRotation, deltaTime * _rotationSharpness);
Debug.Log(_camera.transform.rotation.eulerAngles);
// Применение финального вращения
_camera.transform.rotation = targetRotation;
Debug.Log(_camera.transform.rotation.eulerAngles);
}
// Обработка позиционирования камеры и зума с учетом текущего режима
private void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
{
// Плавное следование за целью с использованием экспоненциального сглаживания
_currentFollowPosition = Vector3.Lerp(_currentFollowPosition, _followTransform.position, 1f - Mathf.Exp(-_followSharpness * deltaTime));
// Вычисление целевой позиции камеры с учетом текущего режима
Vector3 targetPosition;
// В FirstPerson режиме камера находится прямо на позиции цели
targetPosition = _currentFollowPosition;
// Установка финальной позиции камеры
_camera.transform.position = targetPosition;
}
// Основной метод обновления камеры, вызываемый извне каждый кадр
public void UpdateWithInput(float deltaTime, float zoomInput, Vector3 rotationInput)
{
// Проверка наличия цели для следования и проверка на режим главного меню
if (!_followTransform) return;
// Обработка ввода и позиционирования
HandleRotationInput(deltaTime, rotationInput, out var targetRotation);
HandlePosition(deltaTime, zoomInput, targetRotation);
}
// Установка цели для следования камеры
public void SetFollowTransform(Transform t)
{
_followTransform = t;
_currentFollowPosition = t.position;
PlanarDirection = t.forward; // Начальное направление совпадает с направлением цели
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8bd4b9c56b1e435d8699160bc950994c
timeCreated: 1761672032
@@ -0,0 +1,23 @@
using Code.StateMachine;
using UnityEngine;
namespace Code.Gameplay.Camera.CameraStates
{
public class StaticState : BaseState<CameraStateMachineContext>
{
private Transform _target;
private Transform _position;
private UnityEngine.Camera _camera;
public StaticState(CameraStateMachineContext context) : base(context)
{
}
public override void EnterState()
{
_camera = Context.Camera;
base.EnterState();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ddbcc6a073b744a08ce31c0607c1e9e9
timeCreated: 1761671944
@@ -0,0 +1,164 @@
using System;
using Code.Input;
using Code.StateMachine;
using UnityEngine;
namespace Code.Gameplay.Camera.CameraStates
{
public class ThirdPersonState : BaseState<CameraStateMachineContext>
{
// Параметры загружаются из CameraConfig
private float
_defaultDistance,
_minDistance,
_maxDistance,
_distanceMovementSpeed,
_rotationSpeed,
_rotationSharpness,
_followSharpness,
_minVerticalAngle,
_maxVerticalAngle,
_defaultVerticalAngle;
// Трансформ объекта, за которым следует камера (для 1st-person: уровень глаз)
private Transform _followTransform;
// Позиция следования: текущая сглаженная позиция и горизонтальное направление камеры
private Vector3 _currentFollowPosition;
// Fallback-позиция для режимов без цели (например, MainMenu)
private Vector3 _defaultFollowPosition;
// Целевой вертикальный угол камеры (наклон вверх/вниз)
private float _targetVerticalAngle;
// Текущая и целевая дистанция камеры от цели
private float _currentDistance, _targetDistance;
// Исходные значения дистанции для восстановления после FirstPerson режима
private float _originalDefaultDistance, _originalMinDistance, _originalMaxDistance;
// Горизонтальное направление камеры (проекция forward на плоскость)
public Vector3 PlanarDirection { get; private set; }
private IInputService _inputService;
private UnityEngine.Camera _camera;
public ThirdPersonState(CameraStateMachineContext context) : base(context)
{
_inputService = context.InputService;
// Загрузка значений из конфига
_defaultDistance = context.Config.defaultDistance;
_minDistance = context.Config.minDistance;
_maxDistance = context.Config.maxDistance;
_distanceMovementSpeed = context.Config.distanceMovementSpeed;
_rotationSpeed = context.Config.rotationSpeed;
_rotationSharpness = context.Config.rotationSharpness;
_followSharpness = context.Config.followSharpness;
_minVerticalAngle = context.Config.minVerticalAngle;
_maxVerticalAngle = context.Config.maxVerticalAngle;
_defaultVerticalAngle = context.Config.defaultVerticalAngle;
_defaultFollowPosition = context.Config.defaultFollowPosition;
// Валидация значений (на случай ручного редактирования конфига)
_defaultDistance = Mathf.Clamp(_defaultDistance, _minDistance, _maxDistance);
_defaultVerticalAngle = Mathf.Clamp(_defaultVerticalAngle, _minVerticalAngle, _maxVerticalAngle);
// Сохраняем оригинальные значения для восстановления
_originalDefaultDistance = _defaultDistance;
_originalMinDistance = _minDistance;
_originalMaxDistance = _maxDistance;
// Инициализация состояния камеры
_currentDistance = _defaultDistance;
_targetDistance = _currentDistance;
_targetVerticalAngle = _defaultVerticalAngle;
PlanarDirection = Vector3.forward; // Начальное направление - вперед по оси Z
_currentFollowPosition = _defaultFollowPosition;
}
public override void EnterState()
{
// Восстанавливаем исходные значения дистанции
_minDistance = _originalMinDistance;
_maxDistance = _originalMaxDistance;
_defaultDistance = _originalDefaultDistance;
_targetDistance = _defaultDistance;
_camera = Context.Camera;
}
public override void LateTick()
{
UpdateWithInput(Time.deltaTime, _inputService.ZoomInput, _inputService.LookInput);
}
// Основной метод обновления камеры, вызываемый извне каждый кадр
public void UpdateWithInput(float deltaTime, float zoomInput, Vector3 rotationInput)
{
// Проверка наличия цели для следования и проверка на режим главного меню
if (!_followTransform) return;
// Обработка ввода и позиционирования
HandleRotationInput(deltaTime, rotationInput, out var targetRotation);
HandlePosition(deltaTime, zoomInput, targetRotation);
}
// Обработка вращения камеры на основе пользовательского ввода
private void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion targetRotation)
{
// Вращение вокруг вертикальной оси (горизонтальный поворот)
var rotationFromInput = Quaternion.Euler(_followTransform.up * (rotationInput.x * _rotationSpeed));
PlanarDirection = rotationFromInput * PlanarDirection;
var planarRotation = Quaternion.LookRotation(PlanarDirection, _followTransform.up);
// Вращение вокруг горизонтальной оси (вертикальный наклон)
_targetVerticalAngle -= rotationInput.y * _rotationSpeed;
_targetVerticalAngle = Math.Clamp(_targetVerticalAngle, _minVerticalAngle, _maxVerticalAngle);
var verticalRotation = Quaternion.Euler(_targetVerticalAngle, 0, 0);
// Интерполяция к целевому вращению для плавности
targetRotation = Quaternion.Slerp(_camera.transform.rotation, planarRotation * verticalRotation,
deltaTime * _rotationSharpness);
// Применение финального вращения
_camera.transform.rotation = targetRotation;
}
// Обработка позиционирования камеры и зума с учетом текущего режима
private void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
{
// Обновление целевой дистанции на основе ввода зума
_targetDistance += zoomInput * _distanceMovementSpeed;
_targetDistance = Mathf.Clamp(_targetDistance, _minDistance, _maxDistance);
// Плавное следование за целью с использованием экспоненциального сглаживания
_currentFollowPosition = Vector3.Lerp(_currentFollowPosition, _followTransform.position,
1f - Mathf.Exp(-_followSharpness * deltaTime));
// Вычисление целевой позиции камеры с учетом текущего режима
Vector3 targetPosition;
// В ThirdPerson режиме камера отодвинута на расстояние от цели
targetPosition = _currentFollowPosition - targetRotation * Vector3.forward * _currentDistance;
// Плавное изменение текущей дистанции к целевой (только для ThirdPerson)
_currentDistance = Mathf.Lerp(_currentDistance, _targetDistance,
1f - Mathf.Exp(-_distanceMovementSpeed * deltaTime));
// Установка финальной позиции камеры
_camera.transform.position = targetPosition;
}
// Установка цели для следования камеры
public void SetFollowTransform(Transform t)
{
_followTransform = t;
_currentFollowPosition = t.position;
PlanarDirection = t.forward; // Начальное направление совпадает с направлением цели
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ec6778ceb9854ff8af7cba4f6285c370
timeCreated: 1761672071
@@ -1,5 +1,6 @@
using System; using System;
using Code.Configs; using Code.Configs;
using Code.Gameplay.Camera;
using Code.Gameplay.Character.Core; using Code.Gameplay.Character.Core;
using Code.StaticData; using Code.StaticData;
using Reflex.Attributes; using Reflex.Attributes;
@@ -1,3 +1,4 @@
using Code.Gameplay.Camera;
using KinematicCharacterController; using KinematicCharacterController;
using UnityEngine; using UnityEngine;
using Code.Gameplay.Character.Core; using Code.Gameplay.Character.Core;
@@ -1,3 +1,4 @@
using Code.Gameplay.Camera;
using Code.Gameplay.Character.Controller.Abilities; using Code.Gameplay.Character.Controller.Abilities;
using Code.Gameplay.Character.Controller.Input; using Code.Gameplay.Character.Controller.Input;
using Code.Gameplay.Character.Controller.Movement; using Code.Gameplay.Character.Controller.Movement;
@@ -1,3 +1,4 @@
using Code.Gameplay.Camera;
using UnityEngine; using UnityEngine;
using Code.Gameplay.Character.Core; using Code.Gameplay.Character.Core;
using KinematicCharacterController; using KinematicCharacterController;
@@ -1,3 +1,5 @@
using Code.Gameplay.Camera;
using Code.Gameplay.Camera.CameraStates;
using Code.Gameplay.Character.Camera; using Code.Gameplay.Character.Camera;
using Code.Gameplay.Character.Controller; using Code.Gameplay.Character.Controller;
using Code.Input; using Code.Input;
@@ -15,7 +17,7 @@ namespace Code.Gameplay.Character.Core
*/ */
public class Character : MonoBehaviour public class Character : MonoBehaviour
{ {
[Inject] private CameraService _cameraService; // Компонент камеры персонажа [Inject] private CameraStateMachine _cameraService; // Компонент камеры персонажа
[SerializeField] private CustomCharacterController customCharacterController; // Компонент управления персонажем [SerializeField] private CustomCharacterController customCharacterController; // Компонент управления персонажем
[SerializeField] private Transform cameraFollowPoint; // Точка следования камеры (уровень глаз для FirstPerson) [SerializeField] private Transform cameraFollowPoint; // Точка следования камеры (уровень глаз для FirstPerson)
@@ -28,25 +30,12 @@ namespace Code.Gameplay.Character.Core
private void Start() private void Start()
{ {
// Настройка камеры для следования за точкой камеры // Настройка камеры для следования за точкой камеры
_cameraService.SetFollowTransform(cameraFollowPoint); ((FirstPersonState)_cameraService.CurrentBaseState).SetFollowTransform(cameraFollowPoint);
_cameraService.SetCameraMode(CameraMode.FirstPerson);
// Включение Gameplay мапа ввода // Включение Gameplay мапа ввода
_inputService.EnableMap(ActionMappings.Gameplay); _inputService.EnableMap(ActionMappings.Gameplay);
} }
// Обработка ввода для камеры (вращение и зум)
private void HandleCameraInput()
{
// Получаем данные ввода из Input System
var lookInput = _inputService.LookInput;
var scrollInput = _inputService.ZoomInput;
// Передаем данные в камеру
_cameraService.UpdateWithInput(Time.deltaTime, scrollInput,
new Vector3(lookInput.x, lookInput.y, 0));
}
// Обработка ввода для движения персонажа // Обработка ввода для движения персонажа
private void HandleCharacterInput() private void HandleCharacterInput()
{ {
@@ -63,8 +52,6 @@ namespace Code.Gameplay.Character.Core
// Передаем информацию о камере для адаптивного поведения // Передаем информацию о камере для адаптивного поведения
inputs.CameraRotation = _cameraService.transform.rotation; inputs.CameraRotation = _cameraService.transform.rotation;
inputs.CameraMode = _cameraService.CurrentMode;
inputs.CameraPlanarDirection = _cameraService.PlanarDirection;
// Передаем ввод в контроллер персонажа // Передаем ввод в контроллер персонажа
customCharacterController.SetInputs(ref inputs); customCharacterController.SetInputs(ref inputs);
@@ -80,7 +67,7 @@ namespace Code.Gameplay.Character.Core
{ {
// Обрабатываем нажатие только один раз при первом обнаружении // Обрабатываем нажатие только один раз при первом обнаружении
case true when !_cameraModeToggleHandled: case true when !_cameraModeToggleHandled:
ToggleCameraMode(); // ToggleCameraMode();
_cameraModeToggleHandled = true; _cameraModeToggleHandled = true;
break; break;
// Сбрасываем флаг когда кнопка отпущена // Сбрасываем флаг когда кнопка отпущена
@@ -90,15 +77,6 @@ namespace Code.Gameplay.Character.Core
} }
} }
// Метод для переключения режимов камеры
private void ToggleCameraMode()
{
var currentMode = _cameraService.CurrentMode;
var newMode = currentMode == CameraMode.FirstPerson ? CameraMode.ThirdPerson : CameraMode.FirstPerson;
_cameraService.SetCameraMode(newMode);
}
// Обновление логики каждый кадр // Обновление логики каждый кадр
private void Update() private void Update()
{ {
@@ -112,8 +90,6 @@ namespace Code.Gameplay.Character.Core
// Обновление после всех вычислений (идеально для камеры) // Обновление после всех вычислений (идеально для камеры)
private void LateUpdate() private void LateUpdate()
{ {
// Обработка ввода для камеры в LateUpdate (после движения персонажа)
HandleCameraInput();
} }
} }
} }
@@ -1,3 +1,4 @@
using Code.Gameplay.Camera;
using UnityEngine; using UnityEngine;
namespace Code.Gameplay.Character.Core namespace Code.Gameplay.Character.Core
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@@ -7,6 +8,7 @@ namespace Code.StateMachine
: MonoBehaviour : MonoBehaviour
where TStateMachineContext : new() where TStateMachineContext : new()
{ {
public TStateEnum CurrentState { get; private set; }
public BaseState<TStateMachineContext> CurrentBaseState { get; private set; } public BaseState<TStateMachineContext> CurrentBaseState { get; private set; }
private BaseState<TStateMachineContext> _previousBaseState; private BaseState<TStateMachineContext> _previousBaseState;
@@ -20,6 +22,10 @@ namespace Code.StateMachine
CurrentBaseState.Tick(); CurrentBaseState.Tick();
} }
protected void LateUpdate()
{
CurrentBaseState.LateTick();
}
public abstract void Initialize(); public abstract void Initialize();
// Костыли 2 шт. для флагового енама в шаблонах // Костыли 2 шт. для флагового енама в шаблонах
@@ -53,6 +59,8 @@ namespace Code.StateMachine
CurrentBaseState.EnterState(); CurrentBaseState.EnterState();
} }
CurrentState = nextState;
return this; return this;
} }
@@ -17,6 +17,7 @@ namespace Code.StateMachine
public virtual void EnterState() => OnEntered?.Invoke(); public virtual void EnterState() => OnEntered?.Invoke();
public virtual void Tick(){} public virtual void Tick(){}
public virtual void LateTick(){}
public virtual void ExitState() => OnExited?.Invoke(); public virtual void ExitState() => OnExited?.Invoke();
} }
@@ -25,3 +25,4 @@ MonoBehaviour:
defaultCameraMode: 0 defaultCameraMode: 0
defaultFollowPosition: {x: 0, y: 0, z: 0} defaultFollowPosition: {x: 0, y: 0, z: 0}
cameraPrefab: {fileID: 4646144043143727929, guid: 8b8bf5712dc5a42c7bd8e22cddb884c3, type: 3} cameraPrefab: {fileID: 4646144043143727929, guid: 8b8bf5712dc5a42c7bd8e22cddb884c3, type: 3}
cameraPrefab2: {fileID: 374984699890489845, guid: 8b8bf5712dc5a42c7bd8e22cddb884c3, type: 3}
@@ -91,7 +91,6 @@ GameObject:
- component: {fileID: 374984699890489845} - component: {fileID: 374984699890489845}
- component: {fileID: 4075496901397588323} - component: {fileID: 4075496901397588323}
- component: {fileID: 7468744325105696788} - component: {fileID: 7468744325105696788}
- component: {fileID: 4646144043143727929}
m_Layer: 0 m_Layer: 0
m_Name: Camera m_Name: Camera
m_TagString: Untagged m_TagString: Untagged
@@ -218,15 +217,3 @@ MonoBehaviour:
m_VarianceClampScale: 0.9 m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0 m_ContrastAdaptiveSharpening: 0
m_Version: 2 m_Version: 2
--- !u!114 &4646144043143727929
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6099115053225634464}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1d98e6c5419411098391c07861e627e, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Code.Gameplay.Character.Camera.CameraService
@@ -208,166 +208,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 55880351} m_GameObject: {fileID: 55880351}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &338454659
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 338454662}
- component: {fileID: 338454661}
- component: {fileID: 338454660}
- component: {fileID: 338454663}
- component: {fileID: 338454664}
m_Layer: 0
m_Name: CharacterCamera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &338454660
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 338454659}
m_Enabled: 1
--- !u!20 &338454661
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 338454659}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &338454662
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 338454659}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
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 &338454663
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 338454659}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_TaaSettings:
m_Quality: 3
m_FrameInfluence: 0.1
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
m_Version: 2
--- !u!114 &338454664
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 338454659}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1d98e6c5419411098391c07861e627e, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Code.Gameplay.Player.PlayerCamera
defaultDistance: 6
minDistance: 3
maxDistance: 10
distanceMovementSpeed: 5
rotationSpeed: 0.3
rotationSharpness: 100
followSharpness: 100
minVerticalAngle: -70
maxVerticalAngle: 70
defaultVerticalAngle: 10
--- !u!1 &453575297 --- !u!1 &453575297
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -904,7 +744,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9f2cdbe59523ace7ab0d8dfc36b4eb02, type: 3} m_Script: {fileID: 11500000, guid: 9f2cdbe59523ace7ab0d8dfc36b4eb02, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Player m_EditorClassIdentifier: Assembly-CSharp::Player
characterCamera: {fileID: 338454664}
customCharacterController: {fileID: 1696686258} customCharacterController: {fileID: 1696686258}
cameraFollowPoint: {fileID: 453575298} cameraFollowPoint: {fileID: 453575298}
--- !u!114 &1696686256 --- !u!114 &1696686256
@@ -1044,7 +883,6 @@ Transform:
SceneRoots: SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_Roots: m_Roots:
- {fileID: 338454662}
- {fileID: 1959874991} - {fileID: 1959874991}
- {fileID: 1696686254} - {fileID: 1696686254}
- {fileID: 481156070} - {fileID: 481156070}
@@ -0,0 +1,690 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3}
m_Name: SOUTHGHETTO SDF
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TMP_FontAsset
m_Version: 1.1.0
m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: SouthGhetto
m_StyleName: Regular
m_PointSize: 90
m_Scale: 1
m_UnitsPerEM: 1000
m_LineHeight: 99
m_AscentLine: 67.5
m_CapLine: 63
m_MeanLine: 63
m_Baseline: 0
m_DescentLine: -22.5
m_SuperscriptOffset: 67.5
m_SuperscriptSize: 0.5
m_SubscriptOffset: -22.5
m_SubscriptSize: 0.5
m_UnderlineOffset: -11.25
m_UnderlineThickness: 4.5
m_StrikethroughOffset: 25.2
m_StrikethroughThickness: 4.5
m_TabWidth: 23
m_Material: {fileID: 1091306912205572362}
m_SourceFontFileGUID: 4c18ae64a0f1d59239a927890bc9aa3f
m_CreationSettings:
sourceFontFileName:
sourceFontFileGUID: 4c18ae64a0f1d59239a927890bc9aa3f
faceIndex: 0
pointSizeSamplingMode: 0
pointSize: 90
padding: 9
paddingMode: 2
packingMode: 0
atlasWidth: 1024
atlasHeight: 1024
characterSetSelectionMode: 7
characterSequence:
referencedFontAssetGUID:
referencedTextAssetGUID:
fontStyle: 0
fontStyleModifier: 0
renderMode: 4165
includeFontFeatures: 0
m_SourceFontFile: {fileID: 12800000, guid: 4c18ae64a0f1d59239a927890bc9aa3f, type: 3}
m_SourceFontFilePath:
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_GlyphTable:
- m_Index: 30
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 10
m_Y: 10
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 60
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 10
m_Y: 92
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 67
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 10
m_Y: 174
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 64
m_Metrics:
m_Width: 31.40625
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 36.8125
m_GlyphRect:
m_X: 10
m_Y: 256
m_Width: 33
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 77
m_Metrics:
m_Width: 53.09375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 58.5
m_GlyphRect:
m_X: 10
m_Y: 338
m_Width: 54
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 73
m_Metrics:
m_Width: 52.203125
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 55.984375
m_GlyphRect:
m_X: 62
m_Y: 256
m_Width: 53
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 94
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 79
m_Y: 92
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 121
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 81
m_Y: 10
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 134
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 79
m_Y: 174
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 118
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 10
m_Y: 420
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 136
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 10
m_Y: 502
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 146
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 79
m_Y: 420
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 88
m_Metrics:
m_Width: 49.234375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 54.625
m_GlyphRect:
m_X: 83
m_Y: 338
m_Width: 50
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 145
m_Metrics:
m_Width: 66.59375
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 72
m_GlyphRect:
m_X: 134
m_Y: 256
m_Width: 68
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 127
m_Metrics:
m_Width: 51.296875
m_Height: 81.359375
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 81.359375
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 150
m_Y: 10
m_Width: 52
m_Height: 82
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 126
m_Metrics:
m_Width: 51.296875
m_Height: 63
m_HorizontalBearingX: 2.703125
m_HorizontalBearingY: 63
m_HorizontalAdvance: 56.703125
m_GlyphRect:
m_X: 148
m_Y: 174
m_Width: 52
m_Height: 63
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
m_CharacterTable:
- m_ElementType: 1
m_Unicode: 68
m_GlyphIndex: 30
m_Scale: 1
- m_ElementType: 1
m_Unicode: 101
m_GlyphIndex: 60
m_Scale: 1
- m_ElementType: 1
m_Unicode: 108
m_GlyphIndex: 67
m_Scale: 1
- m_ElementType: 1
m_Unicode: 105
m_GlyphIndex: 64
m_Scale: 1
- m_ElementType: 1
m_Unicode: 118
m_GlyphIndex: 77
m_Scale: 1
- m_ElementType: 1
m_Unicode: 114
m_GlyphIndex: 73
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1048
m_GlyphIndex: 94
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1075
m_GlyphIndex: 121
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1088
m_GlyphIndex: 134
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1072
m_GlyphIndex: 118
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1090
m_GlyphIndex: 136
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1100
m_GlyphIndex: 146
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1042
m_GlyphIndex: 88
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1099
m_GlyphIndex: 145
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1081
m_GlyphIndex: 127
m_Scale: 1
- m_ElementType: 1
m_Unicode: 1080
m_GlyphIndex: 126
m_Scale: 1
m_AtlasTextures:
- {fileID: 688428377202190775}
m_AtlasTextureIndex: 0
m_IsMultiAtlasTexturesEnabled: 0
m_GetFontFeatures: 1
m_ClearDynamicDataOnBuild: 1
m_AtlasWidth: 1024
m_AtlasHeight: 1024
m_AtlasPadding: 9
m_AtlasRenderMode: 4165
m_UsedGlyphRects:
- m_X: 0
m_Y: 0
m_Width: 71
m_Height: 82
- m_X: 0
m_Y: 82
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 164
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 246
m_Width: 52
m_Height: 82
- m_X: 0
m_Y: 328
m_Width: 73
m_Height: 82
- m_X: 52
m_Y: 246
m_Width: 72
m_Height: 82
- m_X: 69
m_Y: 82
m_Width: 71
m_Height: 82
- m_X: 71
m_Y: 0
m_Width: 69
m_Height: 82
- m_X: 69
m_Y: 164
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 410
m_Width: 69
m_Height: 82
- m_X: 0
m_Y: 492
m_Width: 71
m_Height: 82
- m_X: 69
m_Y: 410
m_Width: 69
m_Height: 82
- m_X: 73
m_Y: 328
m_Width: 69
m_Height: 82
- m_X: 124
m_Y: 246
m_Width: 87
m_Height: 82
- m_X: 140
m_Y: 0
m_Width: 71
m_Height: 101
- m_X: 138
m_Y: 164
m_Width: 71
m_Height: 82
m_FreeGlyphRects:
- m_X: 0
m_Y: 574
m_Width: 1023
m_Height: 449
- m_X: 71
m_Y: 492
m_Width: 952
m_Height: 531
- m_X: 138
m_Y: 410
m_Width: 885
m_Height: 613
- m_X: 142
m_Y: 328
m_Width: 881
m_Height: 695
- m_X: 211
m_Y: 0
m_Width: 812
m_Height: 1023
- m_X: 140
m_Y: 101
m_Width: 883
m_Height: 63
- m_X: 209
m_Y: 101
m_Width: 814
m_Height: 145
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
m_ShouldReimportFontFeatures: 0
m_FallbackFontAssetTable: []
m_FontWeightTable:
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
fontWeights: []
normalStyle: 0
normalSpacingOffset: 0
boldStyle: 0.75
boldSpacing: 7
italicStyle: 35
tabSize: 10
m_fontInfo:
Name:
PointSize: 0
Scale: 0
CharacterCount: 0
LineHeight: 0
Baseline: 0
Ascender: 0
CapHeight: 0
Descender: 0
CenterLine: 0
SuperscriptOffset: 0
SubscriptOffset: 0
SubSize: 0
Underline: 0
UnderlineThickness: 0
strikethrough: 0
strikethroughThickness: 0
TabWidth: 0
Padding: 0
AtlasWidth: 0
AtlasHeight: 0
m_glyphInfoList: []
m_KerningTable:
kerningPairs: []
fallbackFontAssets: []
atlas: {fileID: 0}
--- !u!28 &688428377202190775
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SOUTHGHETTO Atlas
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_IsAlphaChannelOptional: 0
serializedVersion: 4
m_Width: 1024
m_Height: 1024
m_CompleteImageSize: 1048576
m_MipsStripped: 0
m_TextureFormat: 1
m_MipCount: 1
m_IsReadable: 1
m_IsPreProcessed: 0
m_IgnoreMipmapLimit: 1
m_MipmapLimitGroupName:
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_VTOnly: 0
m_AlphaIsTransparency: 0
m_ImageCount: 1
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 1
m_PlatformBlob:
image data: 1048576
_typelessdata: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000407090a131313131313131313131313131212121212121212121212121212121212121212110f0d0a0706040100000000000000000000000000000000000000000000000000000407090a1313131313131313131313130e0d0b07030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000407090a13131313131313131313131311070604000000000000000000000000000000000001070b0f111213131313131313131313131313120f0a05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050b101416172020202020202020202020201f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1e1e1c1a171413110d080100000000000000000000000000000000000000000000050b101416172020202020202020202020201a1a17130e08010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050b101416172020202020202020202020201e1413100c070100000000000000000000000000050c12171b1d1e202020202020202020202020201e1b16100901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Line truncated
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
--- !u!21 &1091306912205572362
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SOUTHGHETTO Atlas Material
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Cube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 688428377202190775}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelRoundness: 0
- _BevelWidth: 0
- _BumpFace: 0
- _BumpOutline: 0
- _ColorMask: 15
- _CullMode: 0
- _Diffuse: 0.5
- _FaceDilate: 0
- _FaceUVSpeedX: 0
- _FaceUVSpeedY: 0
- _GlowInner: 0.05
- _GlowOffset: 0
- _GlowOuter: 0.05
- _GlowPower: 0.75
- _GradientScale: 10
- _LightAngle: 3.1416
- _MaskSoftnessX: 0
- _MaskSoftnessY: 0
- _OutlineSoftness: 0
- _OutlineUVSpeedX: 0
- _OutlineUVSpeedY: 0
- _OutlineWidth: 0
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _ScaleRatioA: 0.9
- _ScaleRatioB: 0.73125
- _ScaleRatioC: 0.73125
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
- _Sharpness: 0
- _SpecularPower: 2
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _TextureHeight: 1024
- _TextureWidth: 1024
- _UnderlayDilate: 0
- _UnderlayOffsetX: 0
- _UnderlayOffsetY: 0
- _UnderlaySoftness: 0
- _VertexOffsetX: 0
- _VertexOffsetY: 0
- _WeightBold: 0.75
- _WeightNormal: 0
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []
m_AllowLocking: 1