This commit is contained in:
2026-06-18 03:12:50 +07:00
parent 81a6798e96
commit d2edd88f9a
30 changed files with 439 additions and 4112 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +0,0 @@
using UnityEngine;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraCharacterFading
{
[Header("Character Fading")]
[SerializeField] private bool useCharacterFading = true;
[SerializeField] private float minVisibleDistance = 1.2f;
[SerializeField] private float fullyHiddenDistance = 0.6f;
[SerializeField] private Renderer[] characterRenderers;
public void HandleCharacterFading(float currentDistance)
{
if (!useCharacterFading || characterRenderers == null || characterRenderers.Length == 0) return;
float alpha = Mathf.InverseLerp(fullyHiddenDistance, minVisibleDistance, currentDistance);
foreach (var renderer in characterRenderers)
{
if (renderer != null)
{
Color color = renderer.material.color;
color.a = alpha;
renderer.material.color = color;
}
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5d5d8d2fa005cd34a92ee259df535130

View File

@@ -1,24 +0,0 @@
using UnityEngine;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraCollisionHandler
{
[Header("Collision Settings")]
[SerializeField] private LayerMask collisionLayers;
[SerializeField] private float cameraRadius = 0.2f;
public float CheckCollision(Vector3 focusPosition, Quaternion currentRotation, float targetDistance, float minimumDistanceAllowed)
{
RaycastHit hit;
Vector3 rayStart = focusPosition;
Vector3 rayDirection = currentRotation * Vector3.back;
if (Physics.SphereCast(rayStart, cameraRadius, rayDirection, out hit, targetDistance, collisionLayers))
{
return Mathf.Max(minimumDistanceAllowed, hit.distance - 0.1f);
}
return targetDistance;
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 57a506759df838e42b577ebdb542500b

View File

@@ -1,294 +0,0 @@
using System; // For Action event
using UnityEngine;
namespace OnlyScove.Scripts
{
public class CameraController : MonoBehaviour
{
public enum CameraViewMode { ThirdPerson, FirstPerson }
public InputReader inputReader; // Đổi từ [SerializeField] thành public
public Transform followTarget; // Player's root for TPV
[SerializeField] float positionSmoothTime = 0.12f;
[SerializeField] float rotationSmoothTime = 5f;
[SerializeField] Vector2 framingOffset;
[Header("Components")]
[SerializeField] private CameraRotationHandler rotationHandler = new CameraRotationHandler();
[SerializeField] private CameraZoomHandler zoomHandler = new CameraZoomHandler();
[SerializeField] private CameraCollisionHandler collisionHandler = new CameraCollisionHandler();
[SerializeField] private CameraOcclusionTransparency occlusionTransparency = new CameraOcclusionTransparency();
[SerializeField] private CameraDynamicFOV dynamicFOV = new CameraDynamicFOV();
[SerializeField] private CameraCharacterFading characterFading = new CameraCharacterFading();
[SerializeField] private CameraSideBias sideBias = new CameraSideBias();
[SerializeField] private CameraShakeManager shakeManager = new CameraShakeManager();
[Header("First Person View Settings")]
[SerializeField] Transform fpvTarget; // Specific transform on the player (e.g., eye level)
[SerializeField] float fpvPositionSmoothTime = 0.05f;
[SerializeField] float fpvRotationSmoothTime = 20f;
[SerializeField] float fpvFOV = 80f;
[SerializeField] float transitionDuration = 0.3f;
[SerializeField] float tpvBaseFOV = 60f; // Existing base FOV for TPV
private Vector3 _currentVelocity;
private Camera _cam;
private CameraViewMode _currentViewMode = CameraViewMode.ThirdPerson;
private CameraViewMode _targetViewMode = CameraViewMode.ThirdPerson;
private float _transitionTimer = 0f;
private bool _inTransition = false;
public CameraViewMode CurrentViewMode => _currentViewMode;
// Properties to get current smoothing values based on view mode
private float CurrentPositionSmoothTime => _currentViewMode == CameraViewMode.FirstPerson ? fpvPositionSmoothTime : positionSmoothTime;
private float CurrentRotationSmoothTime => _currentViewMode == CameraViewMode.FirstPerson ? fpvRotationSmoothTime : rotationSmoothTime;
// Public properties for UI binding
public float Sensitivity => rotationHandler != null ? GetPrivateSensitivity() : 1f;
public bool InvertX => rotationHandler != null ? GetPrivateInvertX() : false;
public bool InvertY => rotationHandler != null ? GetPrivateInvertY() : false;
private float GetPrivateSensitivity()
{
var field = typeof(CameraRotationHandler).GetField("sensitivity", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
return field != null ? (float)field.GetValue(rotationHandler) : 0.1f;
}
private bool GetPrivateInvertX()
{
var field = typeof(CameraRotationHandler).GetField("invertX", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
return field != null ? (bool)field.GetValue(rotationHandler) : false;
}
private bool GetPrivateInvertY()
{
var field = typeof(CameraRotationHandler).GetField("invertY", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
return field != null ? (bool)field.GetValue(rotationHandler) : false;
}
public void SetFOV(float value)
{
tpvBaseFOV = value;
if (_currentViewMode == CameraViewMode.ThirdPerson && !_inTransition)
{
_cam.fieldOfView = value;
}
}
private void OnEnable()
{
if (inputReader != null)
{
inputReader.OnToggleViewEvent += ToggleCameraView;
}
if (SettingsManager.Instance != null)
{
SettingsManager.Instance.OnSettingsChanged += ApplyGlobalSettings;
ApplyGlobalSettings();
}
}
private void OnDisable()
{
if (inputReader != null)
{
inputReader.OnToggleViewEvent -= ToggleCameraView;
}
if (SettingsManager.Instance != null)
{
SettingsManager.Instance.OnSettingsChanged -= ApplyGlobalSettings;
}
}
private void ApplyGlobalSettings()
{
if (SettingsManager.Instance == null || SettingsManager.Instance.Settings == null) return;
var settings = SettingsManager.Instance.Settings;
// Note: Since I cannot modify CameraRotationHandler.cs, I am using reflection
// to fulfill the "apply these values dynamically" requirement without changing the file.
// This is a workaround requested by the user's constraint.
var type = typeof(CameraRotationHandler);
type.GetField("sensitivity", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?.SetValue(rotationHandler, settings.sensitivity * 0.1f);
type.GetField("invertX", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?.SetValue(rotationHandler, settings.invertX);
type.GetField("invertY", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?.SetValue(rotationHandler, settings.invertY);
SetFOV(settings.fieldOfView);
}
private void Start()
{
_cam = GetComponent<Camera>();
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
rotationHandler.Initialize(transform);
dynamicFOV.Initialize(tpvBaseFOV: tpvBaseFOV, fpvFOV: fpvFOV); // Pass TPV and FPV base FOVs
}
private void Update()
{
if (followTarget == null) return;
HandleViewTransition();
// If we are in transition, HandleViewTransition takes full control of the camera transform
if (_inTransition) return;
if (inputReader != null)
{
// Input-related updates are handled differently based on view mode
rotationHandler.HandleRotation(inputReader, followTarget, CurrentRotationSmoothTime, _currentViewMode);
if (_currentViewMode == CameraViewMode.ThirdPerson)
{
zoomHandler.HandleZoom(inputReader);
sideBias.HandleSideBias(inputReader);
}
else
{
// Disable side bias and zoom in FPV
sideBias.HandleSideBias(null); // Pass null to effectively disable
zoomHandler.HandleZoom(null); // Pass null to effectively disable
}
dynamicFOV.HandleDynamicFOV(_cam, inputReader, _currentViewMode);
}
Vector3 focusPosition;
float targetDistance;
if (_currentViewMode == CameraViewMode.ThirdPerson)
{
// TPV specific calculations
transform.rotation = rotationHandler.CurrentRotation; // Set camera rotation from handler
focusPosition = followTarget.position + rotationHandler.CurrentRotation * new Vector3(framingOffset.x + sideBias.CurrentSideBias, framingOffset.y, 0);
targetDistance = collisionHandler.CheckCollision(focusPosition, rotationHandler.CurrentRotation, zoomHandler.CurrentDistance, zoomHandler.MinDistance);
characterFading.HandleCharacterFading(targetDistance);
occlusionTransparency.HandleTransparency(transform, focusPosition);
// Reset near clip plane for TPV if needed
if (_cam.nearClipPlane < 0.1f) _cam.nearClipPlane = 0.3f;
}
else // FirstPerson
{
// FPV specific calculations
if (followTarget != null) followTarget.rotation = rotationHandler.PlanarRotation;
if (fpvTarget != null) fpvTarget.rotation = rotationHandler.CurrentRotation;
transform.rotation = rotationHandler.CurrentRotation;
focusPosition = fpvTarget.position;
targetDistance = 0;
// AGGRESSIVE DEBUG FIX:
_cam.nearClipPlane = 0.01f;
_cam.farClipPlane = 2000f; // Ensure world isn't being cut off
_cam.cullingMask = -1; // Force camera to see EVERY LAYER
// Disable these temporarily to see if they are the cause
// characterFading.HandleCharacterFading(0.01f);
occlusionTransparency.ResetLastRenderer();
}
// Calculate target position using the currently set transform.rotation
Vector3 targetPosition = focusPosition - transform.rotation * new Vector3(0, 0, targetDistance);
// Handle camera shake
shakeManager.HandleShake();
// Apply final position and rotation
transform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref _currentVelocity, CurrentPositionSmoothTime) + shakeManager.ShakeOffset;
}
public void ToggleCameraView()
{
if (_inTransition) return; // Prevent multiple toggles during transition
_targetViewMode = (_currentViewMode == CameraViewMode.ThirdPerson) ? CameraViewMode.FirstPerson : CameraViewMode.ThirdPerson;
if (_targetViewMode == CameraViewMode.FirstPerson && fpvTarget == null)
{
Debug.LogWarning("[CameraController] Cannot switch to FPV: fpvTarget is not assigned!");
return;
}
// Initialize rotation handler immediately so PlanarRotation is correct during transition
if (_targetViewMode == CameraViewMode.FirstPerson)
{
rotationHandler.InitializeFPV(fpvTarget);
}
else
{
rotationHandler.Initialize(transform);
}
Debug.Log($"[CameraController] Toggling view from {_currentViewMode} to {_targetViewMode}");
_inTransition = true;
_transitionTimer = 0f;
}
private void HandleViewTransition()
{
if (!_inTransition) return;
_transitionTimer += Time.deltaTime;
float t = _transitionTimer / transitionDuration;
t = Mathf.Clamp01(t); // Clamp t between 0 and 1
// Smoothly interpolate parameters during transition
if (_targetViewMode == CameraViewMode.FirstPerson)
{
// TPV -> FPV transition
// Interpolate FOV
_cam.fieldOfView = Mathf.Lerp(dynamicFOV.CurrentTpvBaseFOV, fpvFOV, t);
// Adjust Near Clip Plane during transition to prevent blue screen (clipping)
_cam.nearClipPlane = Mathf.Lerp(0.3f, 0.01f, t);
// Rotate player body to match camera's intended horizontal look direction
if (followTarget != null)
{
followTarget.rotation = Quaternion.Slerp(followTarget.rotation, rotationHandler.PlanarRotation, t);
}
// Interpolate position and rotation
if (fpvTarget != null)
{
transform.position = Vector3.Lerp(transform.position, fpvTarget.position, t);
transform.rotation = Quaternion.Slerp(transform.rotation, fpvTarget.rotation, t);
}
}
else
{
// FPV -> TPV transition
// Interpolate FOV
_cam.fieldOfView = Mathf.Lerp(fpvFOV, dynamicFOV.CurrentTpvBaseFOV, t);
_cam.nearClipPlane = Mathf.Lerp(0.01f, 0.3f, t);
}
if (t >= 1f)
{
_currentViewMode = _targetViewMode;
Debug.Log($"[CameraController] View transition complete. Current mode: {_currentViewMode}");
_inTransition = false;
// Ensure final values are set correctly
_cam.fieldOfView = (_currentViewMode == CameraViewMode.FirstPerson) ? fpvFOV : dynamicFOV.CurrentTpvBaseFOV;
_cam.nearClipPlane = (_currentViewMode == CameraViewMode.FirstPerson) ? 0.01f : 0.3f;
}
}
public void Shake(float intensity, float duration)
{
shakeManager.Shake(intensity, duration);
}
public void TriggerFallImpactShake(float fallHeight)
{
shakeManager.TriggerFallImpactShake(fallHeight);
}
public Quaternion PlanarRotation => rotationHandler.PlanarRotation;
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: d3a2f40f0d755824f91dfa62616cd6fc

View File

@@ -1,45 +0,0 @@
using UnityEngine;
using static OnlyScove.Scripts.CameraController; // Need to add this to access CameraController.CameraViewMode
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraDynamicFOV
{
[Header("Dynamic FOV")]
[SerializeField] private bool useDynamicFOV = true;
[SerializeField] private float tpvSprintFOV = 70f; // Renamed from sprintFOV for clarity
[SerializeField] private float fpvSprintFOV = 95f; // Target FOV for sprinting in FPV
[SerializeField] private float fovSmoothTime = 5f;
private float _currentTpvBaseFOV; // Stored from CameraController
private float _currentFpvFOV; // Stored from CameraController
public float CurrentTpvBaseFOV => _currentTpvBaseFOV; // Expose for CameraController transitions
public void Initialize(float tpvBaseFOV, float fpvFOV)
{
_currentTpvBaseFOV = tpvBaseFOV;
_currentFpvFOV = fpvFOV;
}
public void HandleDynamicFOV(Camera cam, InputReader inputReader, CameraViewMode viewMode)
{
if (!useDynamicFOV || cam == null || inputReader == null) return;
bool isSprinting = inputReader.MoveInput.magnitude > 0.1f && inputReader.IsSprintHeld;
float targetFOV;
if (viewMode == CameraViewMode.ThirdPerson)
{
targetFOV = isSprinting ? tpvSprintFOV : _currentTpvBaseFOV;
}
else // FirstPerson
{
targetFOV = isSprinting ? fpvSprintFOV : _currentFpvFOV;
}
cam.fieldOfView = Mathf.Lerp(cam.fieldOfView, targetFOV, fovSmoothTime * Time.deltaTime);
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 99cfe3471dc945a4fad66b3b440c2c12

View File

@@ -1,66 +0,0 @@
using UnityEngine;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraOcclusionTransparency
{
[Header("Occlusion Transparency")]
[SerializeField] private bool useTransparency = true;
[SerializeField] private LayerMask transparencyLayers;
[SerializeField] private float fadeAlpha = 0.3f;
private Renderer _lastFadedRenderer;
private Color _originalColor;
public void HandleTransparency(Transform cameraTransform, Vector3 focusPosition)
{
if (!useTransparency)
{
ResetLastRenderer();
return;
}
Vector3 direction = focusPosition - cameraTransform.position;
float distanceToPlayer = direction.magnitude;
// Prevent raycasting if we are too close (common in FPV)
if (distanceToPlayer < 0.1f)
{
ResetLastRenderer();
return;
}
RaycastHit hit;
if (Physics.Raycast(cameraTransform.position, direction.normalized, out hit, distanceToPlayer, transparencyLayers))
{
Renderer renderer = hit.collider.GetComponent<Renderer>();
if (renderer != null && renderer != _lastFadedRenderer)
{
ResetLastRenderer();
_lastFadedRenderer = renderer;
_originalColor = renderer.material.color;
Color fadedColor = _originalColor;
fadedColor.a = fadeAlpha;
renderer.material.color = fadedColor;
}
}
else
{
ResetLastRenderer();
}
}
public void ResetLastRenderer()
{
if (_lastFadedRenderer != null)
{
_lastFadedRenderer.material.color = _originalColor;
_lastFadedRenderer = null;
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 8ad64ce0d02e30243acc55aa0ebc74a9

View File

@@ -1,99 +0,0 @@
using UnityEngine;
using static OnlyScove.Scripts.CameraController;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraRotationHandler
{
[Header("Rotation Settings")]
[SerializeField] private float sensitivity = 0.1f;
[SerializeField] private float minVerticalAngle = -45f;
[SerializeField] private float maxVerticalAngle = 45f;
[SerializeField] private bool invertX;
[SerializeField] private bool invertY;
[Header("Auto Rotation")]
[SerializeField] private bool useAutoRotation = true;
[SerializeField] private float autoRotateDelay = 2.5f;
[SerializeField] private float autoRotateSpeed = 2f;
private float _rotationX;
private float _rotationY;
private float _lastInputTime;
public Quaternion CurrentRotation { get; private set; } // Camera's actual rotation
public Quaternion PlanarRotation => Quaternion.Euler(0f, _rotationY, 0f); // Horizontal rotation (for player body in FPV)
public void Initialize(Transform cameraTransform)
{
_rotationX = cameraTransform.eulerAngles.x;
_rotationY = cameraTransform.eulerAngles.y;
_lastInputTime = Time.time;
CurrentRotation = cameraTransform.rotation;
}
// New method to initialize rotation specifically for FPV
public void InitializeFPV(Transform fpvTargetTransform)
{
Vector3 eulers = fpvTargetTransform.eulerAngles;
// Normalize angles to -180 to 180 range for clamping
_rotationX = eulers.x;
if (_rotationX > 180) _rotationX -= 360;
_rotationY = eulers.y;
_lastInputTime = Time.time;
CurrentRotation = fpvTargetTransform.rotation; // Camera starts matching fpvTarget rotation
}
public void HandleRotation(InputReader inputReader, Transform followTarget, float rotationSmoothTime, CameraViewMode viewMode)
{
if (inputReader == null) return;
// Debug for rotation
if (inputReader.LookInput.sqrMagnitude > 0.001f)
{
// Debug.Log($"[CameraRotationHandler] LookInput: {inputReader.LookInput}, _rotationX: {_rotationX}, _rotationY: {_rotationY}, ViewMode: {viewMode}");
}
// Update _lastInputTime regardless of view mode if there's look input
if (inputReader.LookInput.magnitude > 0.01f)
{
_lastInputTime = Time.time;
}
float invertXVal = (invertX) ? -1 : 1;
float invertYVal = (invertY) ? -1 : 1;
_rotationX -= inputReader.LookInput.y * invertYVal * sensitivity * Time.deltaTime;
_rotationX = Mathf.Clamp(_rotationX, minVerticalAngle, maxVerticalAngle);
_rotationY += inputReader.LookInput.x * invertXVal * sensitivity * Time.deltaTime;
if (viewMode == CameraViewMode.ThirdPerson)
{
// Auto-Correction for TPV
if (useAutoRotation && Time.time - _lastInputTime > autoRotateDelay)
{
if (inputReader.MoveInput.magnitude > 0.1f)
{
float targetYaw = followTarget.eulerAngles.y;
_rotationY = Mathf.LerpAngle(_rotationY, targetYaw, autoRotateSpeed * Time.deltaTime);
}
}
Quaternion targetRotation = Quaternion.Euler(_rotationX, _rotationY, 0f);
CurrentRotation = Quaternion.Slerp(CurrentRotation, targetRotation, rotationSmoothTime * Time.deltaTime);
}
else // FirstPerson
{
// In FPV, CurrentRotation *is* the camera's rotation (head rotation)
// The horizontal part of this (_rotationY) will also be used to rotate the player's body.
Quaternion targetRotation = Quaternion.Euler(_rotationX, _rotationY, 0f);
CurrentRotation = Quaternion.Slerp(CurrentRotation, targetRotation, rotationSmoothTime * Time.deltaTime);
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 92ec094a714577d49be74c0fedb3eeb3

View File

@@ -1,78 +0,0 @@
using UnityEngine;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraShakeManager
{
[SerializeField] private bool useShake = true;
[SerializeField] private float shakeFrequency = 25f; // How fast the shake oscillates
[SerializeField]
private AnimationCurve decayCurve = AnimationCurve.EaseInOut(0, 1, 1, 0); // How intensity decays over duration
[Header("Fall Impact Settings")] [SerializeField]
private bool enableFallImpactShake = true;
[SerializeField] private float minFallHeightForShake = 2f;
[SerializeField] private float maxFallHeightForShake = 10f;
[SerializeField] private float minFallShakeIntensity = 0.5f;
[SerializeField] private float maxFallShakeIntensity = 3f;
[SerializeField] private float minFallShakeDuration = 0.2f;
[SerializeField] private float maxFallShakeDuration = 0.8f;
[SerializeField] private AnimationCurve fallHeightToIntensityCurve = AnimationCurve.Linear(0, 0, 1, 1);
[SerializeField] private AnimationCurve fallHeightToDurationCurve = AnimationCurve.Linear(0, 0, 1, 1);
private float _shakeIntensity = 0f;
private float _shakeDuration = 0f;
private float _shakeTimer = 0f; // Counts down from _shakeDuration
private Vector3 _shakeOffset;
public Vector3 ShakeOffset => _shakeOffset;
public void HandleShake()
{
if (!useShake || _shakeTimer <= 0)
{
_shakeOffset = Vector3.zero;
return;
}
_shakeTimer -= Time.deltaTime;
float progress = 1f - (_shakeTimer / _shakeDuration); // 0 at start, 1 at end
// Apply decay curve to intensity
float currentIntensity = _shakeIntensity * decayCurve.Evaluate(progress);
// Use shakeFrequency for Perlin noise
float shakeX = (Mathf.PerlinNoise(Time.time * shakeFrequency, 0f) - 0.5f) * 2f;
float shakeY = (Mathf.PerlinNoise(0f, Time.time * shakeFrequency) - 0.5f) * 2f;
float shakeZ = (Mathf.PerlinNoise(Time.time * shakeFrequency, Time.time * shakeFrequency) - 0.5f) * 2f;
_shakeOffset = new Vector3(shakeX, shakeY, shakeZ) * currentIntensity;
}
public void Shake(float intensity, float duration)
{
_shakeIntensity = intensity;
_shakeDuration = duration;
_shakeTimer = duration; // Reset timer
}
public void TriggerFallImpactShake(float fallHeight)
{
if (!enableFallImpactShake || fallHeight < minFallHeightForShake) return;
// Normalize fall height between 0 and 1 relative to min/max thresholds
float normalizedFallHeight = Mathf.InverseLerp(minFallHeightForShake, maxFallHeightForShake, fallHeight);
// Calculate intensity and duration using curves and ranges
float intensity = Mathf.Lerp(minFallShakeIntensity, maxFallShakeIntensity,
fallHeightToIntensityCurve.Evaluate(normalizedFallHeight));
float duration = Mathf.Lerp(minFallShakeDuration, maxFallShakeDuration,
fallHeightToDurationCurve.Evaluate(normalizedFallHeight));
Shake(intensity, duration);
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 16e87ee63ce87ac4cb7b952772318c0e

View File

@@ -1,39 +0,0 @@
using UnityEngine;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraSideBias
{
[Header("Side Bias")]
[SerializeField] private bool useSideBias = true;
[SerializeField] private float horizontalBiasAmount = 0.5f;
[SerializeField] private float biasSmoothTime = 3f;
private float _currentSideBias;
public float CurrentSideBias => _currentSideBias;
public void HandleSideBias(InputReader inputReader)
{
float targetBias = 0f;
if (SettingsManager.Instance != null && SettingsManager.Instance.Settings != null)
{
// Fixed offset based on settings
targetBias = SettingsManager.Instance.Settings.sideBiasRight ? horizontalBiasAmount : -horizontalBiasAmount;
}
if (useSideBias && inputReader != null)
{
// Optionally combine with movement-based bias if desired,
// but following requirement "Toggling the camera offset between Left/Right"
_currentSideBias = Mathf.Lerp(_currentSideBias, targetBias, biasSmoothTime * Time.deltaTime);
}
else
{
_currentSideBias = Mathf.Lerp(_currentSideBias, 0, biasSmoothTime * Time.deltaTime);
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: f6bf6a3797a87fb4fb086c1625b1e7bb

View File

@@ -1,29 +0,0 @@
using UnityEngine;
namespace OnlyScove.Scripts
{
[System.Serializable]
public class CameraZoomHandler
{
[Header("Zoom Settings")]
[SerializeField] private float distance = 5;
[SerializeField] private float minDistance = 2f;
[SerializeField] private float maxDistance = 15f;
[SerializeField] private float zoomSensitivity = 1f;
public float CurrentDistance => distance;
public float MinDistance => minDistance;
public void HandleZoom(InputReader inputReader)
{
if (inputReader == null) return;
float scrollDelta = inputReader.ScrollInput.y;
if (Mathf.Abs(scrollDelta) > 0.1f)
{
distance -= scrollDelta * zoomSensitivity * Time.deltaTime;
distance = Mathf.Clamp(distance, minDistance, maxDistance);
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 416c8d0f8adfcbc4390cd2e4e369e0db

View File

@@ -30,7 +30,7 @@ namespace Invector.vCamera
#region inspector properties
public Transform mainTarget;
public InputReader inputReader;
// public InputReader inputReader;
[Header("First Person View")]
public Transform fpvTarget;
@@ -38,10 +38,10 @@ namespace Invector.vCamera
[SerializeField] protected float transitionDuration = 0.3f;
[Header("Modular Features")]
[SerializeField] protected CameraCharacterFading characterFading = new CameraCharacterFading();
[SerializeField] protected CameraOcclusionTransparency occlusionTransparency = new CameraOcclusionTransparency();
[SerializeField] protected CameraDynamicFOV dynamicFOV = new CameraDynamicFOV();
[SerializeField] protected CameraShakeManager shakeManager = new CameraShakeManager();
// [SerializeField] protected CameraCharacterFading characterFading = new CameraCharacterFading();
// [SerializeField] protected CameraOcclusionTransparency occlusionTransparency = new CameraOcclusionTransparency();
// [SerializeField] protected CameraDynamicFOV dynamicFOV = new CameraDynamicFOV();
// [SerializeField] protected CameraShakeManager shakeManager = new CameraShakeManager();
[Tooltip("Lerp speed between Camera States")]
[SerializeField] protected float _smoothBetweenState = 6f;
@@ -215,20 +215,20 @@ namespace Invector.vCamera
protected virtual void OnEnable()
{
if (inputReader != null)
{
inputReader.OnToggleViewEvent += ToggleCameraView;
inputReader.OnSwitchSideEvent += ToggleSwitchSide;
}
// if (inputReader != null)
// {
// inputReader.OnToggleViewEvent += ToggleCameraView;
// inputReader.OnSwitchSideEvent += ToggleSwitchSide;
// }
}
protected virtual void OnDisable()
{
if (inputReader != null)
{
inputReader.OnToggleViewEvent -= ToggleCameraView;
inputReader.OnSwitchSideEvent -= ToggleSwitchSide;
}
// if (inputReader != null)
// {
// inputReader.OnToggleViewEvent -= ToggleCameraView;
// inputReader.OnSwitchSideEvent -= ToggleSwitchSide;
// }
}
public virtual void ToggleSwitchSide()
@@ -269,7 +269,7 @@ namespace Invector.vCamera
public virtual void TriggerFallImpactShake(float fallHeight)
{
shakeManager.TriggerFallImpactShake(fallHeight);
// shakeManager.TriggerFallImpactShake(fallHeight);
}
/// <summary>
@@ -282,8 +282,8 @@ namespace Invector.vCamera
return;
}
if (inputReader == null) inputReader = mainTarget.GetComponent<InputReader>();
if (inputReader == null) inputReader = GameObject.FindFirstObjectByType<InputReader>();
// if (inputReader == null) inputReader = mainTarget.GetComponent<InputReader>();
// if (inputReader == null) inputReader = GameObject.FindFirstObjectByType<InputReader>();
firstUpdated = true;
useSmooth = true;
@@ -332,7 +332,7 @@ namespace Invector.vCamera
currentTargetPos = new Vector3(currentTarget.position.x, currentTarget.position.y + offSetPlayerPivot, currentTarget.position.z) + currentTarget.transform.up * lerpState.height;
targetLookAt.position = currentTargetPos;
dynamicFOV.Initialize(currentState.fov, fpvFOV);
// dynamicFOV.Initialize(currentState.fov, fpvFOV);
isInit = true;
}
@@ -376,13 +376,13 @@ namespace Invector.vCamera
}
// Modular Features
if (inputReader != null)
{
dynamicFOV.HandleDynamicFOV(targetCamera, inputReader,
currentState.cameraMode == TPCameraMode.FirstPerson ? CameraController.CameraViewMode.FirstPerson : CameraController.CameraViewMode.ThirdPerson);
}
shakeManager.HandleShake();
transform.position += shakeManager.ShakeOffset;
// if (inputReader != null)
// {
// dynamicFOV.HandleDynamicFOV(targetCamera, inputReader,
// currentState.cameraMode == TPCameraMode.FirstPerson ? CameraController.CameraViewMode.FirstPerson : CameraController.CameraViewMode.ThirdPerson);
// }
// shakeManager.HandleShake();
// transform.position += shakeManager.ShakeOffset;
}
/// <summary>
@@ -1016,8 +1016,8 @@ namespace Invector.vCamera
selfRigidbody.MoveRotation(Quaternion.Lerp(startRotation, _rot, transformWeight));
// Apply Fading and Transparency
characterFading.HandleCharacterFading(distance);
occlusionTransparency.HandleTransparency(transform, targetPos);
// characterFading.HandleCharacterFading(distance);
// occlusionTransparency.HandleTransparency(transform, targetPos);
movementSpeed = Vector2.zero;
}
@@ -1048,8 +1048,8 @@ namespace Invector.vCamera
mainTarget.rotation = Quaternion.Euler(0, targetLookAt.eulerAngles.y, 0);
}
characterFading.HandleCharacterFading(0); // Fully hide character head if desired, or set to distance 0 for full hidden
occlusionTransparency.HandleTransparency(transform, fpvTarget.position);
// characterFading.HandleCharacterFading(0); // Fully hide character head if desired, or set to distance 0 for full hidden
// occlusionTransparency.HandleTransparency(transform, fpvTarget.position);
}
protected virtual void CameraFixed()

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 9477ecbb64ef4d9c8863fb16d2c4bc96
timeCreated: 1773383891

View File

@@ -1,87 +0,0 @@
using UnityEngine;
using UnityEngine.InputSystem;
namespace OnlyScove.Scripts
{
public class PlayerDebugProvider : MonoBehaviour
{
[Header("References")]
// [SerializeField] private PlayerStateMachine stateMachine;
[Tooltip("Kéo cái Canvas (World Space) bạn đã thiết kế vào đây")]
[SerializeField] private GameObject debugCanvas;
[Header("Follow Settings")]
[SerializeField] private Vector3 followOffset = new Vector3(1.5f, 2f, 0f);
[SerializeField] private float smoothTime = 0.15f;
[SerializeField] private bool lookAtCamera = true;
// Các thuộc tính Public để bạn truy cập từ Script UI của bạn
// public string CurrentState => stateMachine != null ? stateMachine.CurrentStateName : "N/A";
// public string GroundedStatus => (stateMachine != null && stateMachine.IsGrounded) ? "YES" : "NO";
// public float HorizontalSpeed => stateMachine != null ? new Vector3(stateMachine.Controller.velocity.x, 0, stateMachine.Controller.velocity.z).magnitude : 0f;
// public float VerticalSpeed => stateMachine != null ? stateMachine.VelocityY : 0f;
//
// // Sửa lỗi truy cập InputReader từ StateMachine
// public Vector2 MoveInput => (stateMachine != null && stateMachine.Input != null) ? stateMachine.Input.MoveInput : Vector2.zero;
// public bool IsSprinting => (stateMachine != null && stateMachine.Input != null) ? stateMachine.Input.IsSprintHeld : false;
//
// public string TargetInteractable => stateMachine != null ? (stateMachine.GetInteractable()?.InteractionPrompt ?? "None") : "N/A";
//
// public IInteractable GetActiveInteractable() => stateMachine?.GetInteractable();
// public Vector3 GetInteractionPoint()
// {
// if (stateMachine == null || stateMachine.Scanner == null) return Vector3.zero;
// return stateMachine.Scanner.GetLastInteractionPoint(stateMachine.InteractionRange, stateMachine.InteractionMask);
// }
private Vector3 currentVelocity;
private Transform cameraTransform;
private bool isVisible = true;
// private void Awake()
// {
// if (stateMachine == null) stateMachine = GetComponent<PlayerStateMachine>();
// cameraTransform = Camera.main?.transform;
//
// if (debugCanvas != null) debugCanvas.SetActive(isVisible);
// }
private void Update()
{
// Toggle Visibility (Ctrl + Shift + B) sử dụng New Input System
if (Keyboard.current != null)
{
bool ctrl = Keyboard.current.leftCtrlKey.isPressed || Keyboard.current.rightCtrlKey.isPressed;
bool shift = Keyboard.current.leftShiftKey.isPressed || Keyboard.current.rightShiftKey.isPressed;
bool bDown = Keyboard.current.bKey.wasPressedThisFrame;
if (ctrl && shift && bDown)
{
isVisible = !isVisible;
if (debugCanvas != null) debugCanvas.SetActive(isVisible);
}
}
}
private void LateUpdate()
{
if (!isVisible || debugCanvas == null) return;
// 1. Damping Follow: UI đuổi theo Player
Vector3 targetPos = transform.position + followOffset;
debugCanvas.transform.position = Vector3.SmoothDamp(
debugCanvas.transform.position,
targetPos,
ref currentVelocity,
smoothTime
);
// 2. Billboard: Luôn nhìn về Camera
if (lookAtCamera && cameraTransform != null)
{
debugCanvas.transform.LookAt(debugCanvas.transform.position + cameraTransform.forward);
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: bf6aff0b7e11d41439ac80f4963a0795

View File

@@ -1,97 +0,0 @@
Elo Rating System
AI Handoff Specification — Hallucinate Game
1. B?i c?nh & M?c tiêu
Game Hallucinate là game PvP online 1v1 (real-time), dùng Photon Fusion / Unity Relay làm backend m?ng. H? th?ng Elo ???c yêu c?u ?? x?p h?ng ng??i ch?i sau m?i tr?n solo, hi?n th? trên màn hình Profile và ?i?u ph?i matchmaking.
Yêu c?u c?t lõi:
• Tính toán Elo sau m?i tr?n 1v1 hoàn thành
• K-factor ??ng theo s? tr?n và rating hi?n t?i
• Persist rating lên server (không ?? client t? tính)
• Tr? v? rating m?i cho c? 2 ng??i ch?i sau tr?n
• Hi?n th? lên ProfileController.cs qua data binding
2. Công th?c Elo
2.1. Expected Score
E(A) = 1 / (1 + 10 ^ ((RatingB - RatingA) / 400))
E(B) = 1 - E(A)
2.2. Rating m?i
NewRating(A) = OldRating(A) + K * (Result - E(A))
Trong ?ó Result: Th?ng = 1.0 | Thua = 0.0 | Hòa = 0.5
2.3. K-Factor ??ng
?i?u ki?n
K Value
Lý do
D??i 30 tr?n (Placement)
40
Rating ch?a ?n ??nh, c?n h?i t? nhanh
Rating < 1200
32
Tier th?p — thay ??i nhi?u h?n
1200 ? Rating < 2000
24
Tier trung bình — cân b?ng
Rating ? 2000
16
Tier cao — ?n ??nh, thay ??i ch?m
2.4. Ví d? tính toán
A (1500) vs B (1200), A th?ng:
E(A) = 1 / (1 + 10^((1200-1500)/400)) = 0.849
E(B) = 0.151
NewRating(A) = 1500 + 24*(1 - 0.849) = 1500 + 3.6 ? 1504
NewRating(B) = 1200 + 32*(0 - 0.151) = 1200 - 4.8 ? 1195
3. Rank Tiers
Rank
Rating Range
Màu g?i ý (UI)
Iron
< 800
#8A8A8A
Bronze
800 999
#CD7F32
Silver
1000 1199
#C0C0C0
Gold
1200 1499
#FFD700
Platinum
1500 1799
#4DC8A0
Diamond
1800 2099
#7B6EE8
Master
? 2100
#E84D8A
Rating kh?i ??u (m?c ??nh): 1000. Rating sàn (floor): 100 — không xu?ng d??i giá tr? này.
4. Placement Matches
• 30 tr?n ??u tiên là Placement Period (gamesPlayed < 30)
• K = 40 trong giai ?o?n này ?? rating h?i t? nhanh v? ?úng v? trí
• Tùy ch?n: không hi?n th? rank badge trong 30 tr?n ??u, ch? hi?n th? '?' ho?c 'Unranked'
• Sau tr?n 30, K-factor chuy?n sang b?ng ??ng ? m?c 2.3
5. Ki?n trúc & Lu?ng d? li?u
5.1. Nguyên t?c quan tr?ng
KHÔNG ?? client t? tính Elo r?i g?i lên. Ph?i tính trên Host/Server ?? tránh cheat.
5.2. Lu?ng x? lý
B??c
Th?c hi?n b?i
Mô t?
1
Client A & B
Tr?n k?t thúc, g?i k?t qu? lên Host qua RPC
2
Host (Photon Fusion)
Nh?n k?t qu?, xác minh h?p l?
3
Host
G?i EloSystem.Calculate() v?i rating c?a 2 ng??i

View File

@@ -1,313 +0,0 @@
using System;
using UnityEngine;
using UnityEngine.InputSystem;
namespace OnlyScove.Scripts
{
public class InputReader : MonoBehaviour
{
[SerializeField] private InputActionAsset inputActions;
public InputActionAsset InputActions => inputActions;
private const string REBINDS_KEY = "InputRebinds";
private void OnEnable()
{
if (inputActions != null)
{
LoadBindings();
inputActions.Enable();
}
}
private void OnDisable()
{
if (inputActions != null)
{
inputActions.Disable();
}
}
public void SaveBindings()
{
if (inputActions == null) return;
string rebinds = inputActions.SaveBindingOverridesAsJson();
PlayerPrefs.SetString(REBINDS_KEY, rebinds);
PlayerPrefs.Save();
}
public void LoadBindings()
{
if (inputActions == null) return;
string rebinds = PlayerPrefs.GetString(REBINDS_KEY, string.Empty);
if (!string.IsNullOrEmpty(rebinds))
{
inputActions.LoadBindingOverridesFromJson(rebinds);
}
}
public void ResetBindings()
{
if (inputActions == null) return;
inputActions.RemoveAllBindingOverrides();
PlayerPrefs.DeleteKey(REBINDS_KEY);
PlayerPrefs.Save();
}
// Continuous Inputs
public virtual Vector2 MoveInput { get; protected set; }
public virtual Vector2 LookInput { get; protected set; }
public virtual Vector2 ScrollInput { get; protected set; }
public virtual bool IsSprintHeld { get; protected set; }
public virtual bool IsAttackHeld { get; protected set; }
public bool IsAimHeld { get; protected set; }
public bool IsBlockHeld { get; protected set; }
public bool IsInteractHeld { get; protected set; }
public bool IsScopeViewHeld { get; protected set; }
public void ApplyNetworkInput(Vector2 move, bool isSprint)
{
MoveInput = move;
IsSprintHeld = isSprint;
}
// One-shot Events
public event Action OnJumpEvent;
public event Action OnDodgeEvent;
public event Action OnSprintEvent;
public event Action OnAttackEvent;
public event Action OnCrouchEvent;
public event Action OnInteractEvent;
public event Action OnNextInteractEvent;
public event Action OnPreviousInteractEvent;
public event Action OnToggleViewEvent;
public event Action OnReloadEvent;
public event Action OnStrongAttackEvent;
public event Action OnSwitchSideEvent;
public event Action OnScopeViewEvent;
// UI Events
public event Action OnToggleSettingsEvent; // Cho Ctrl+O
public event Action OnCancelEvent; // Cho phím ESC hoặc phím đóng UI
// Polling flags
private bool wasAttackPressed;
private bool wasStrongAttackPressed;
private bool wasReloadPressed;
private bool wasSwitchSidePressed;
private bool wasScopeViewPressed;
private bool wasInteractPressed;
private bool wasDodgePressed;
private bool wasCrouchPressed;
private bool wasJumpPressed;
private bool wasAimReleased;
private bool wasNextPressed;
private bool wasPreviousPressed;
private bool wasToggleViewPressed;
public bool ConsumeAttack() { bool v = wasAttackPressed; wasAttackPressed = false; return v; }
public bool ConsumeStrongAttack() { bool v = wasStrongAttackPressed; wasStrongAttackPressed = false; return v; }
public bool ConsumeReload() { bool v = wasReloadPressed; wasReloadPressed = false; return v; }
public bool ConsumeSwitchSide() { bool v = wasSwitchSidePressed; wasSwitchSidePressed = false; return v; }
public bool ConsumeScopeView() { bool v = wasScopeViewPressed; wasScopeViewPressed = false; return v; }
public bool ConsumeInteract() { bool v = wasInteractPressed; wasInteractPressed = false; return v; }
public bool ConsumeDodge() { bool v = wasDodgePressed; wasDodgePressed = false; return v; }
public bool ConsumeCrouch() { bool v = wasCrouchPressed; wasCrouchPressed = false; return v; }
public bool ConsumeJump() { bool v = wasJumpPressed; wasJumpPressed = false; return v; }
public bool ConsumeAimReleased() { bool v = wasAimReleased; wasAimReleased = false; return v; }
public bool ConsumeNext() { bool v = wasNextPressed; wasNextPressed = false; return v; }
public bool ConsumePrevious() { bool v = wasPreviousPressed; wasPreviousPressed = false; return v; }
public bool ConsumeToggleView() { bool v = wasToggleViewPressed; wasToggleViewPressed = false; return v; }
public void OnAttack(InputAction.CallbackContext context)
{
if (context.performed)
{
wasAttackPressed = true;
OnAttackEvent?.Invoke();
IsAttackHeld = true;
}
if (context.canceled)
{
IsAttackHeld = false;
}
}
public void OnMove(InputAction.CallbackContext context)
{
MoveInput = context.ReadValue<Vector2>();
}
public void OnLook(InputAction.CallbackContext context)
{
LookInput = context.ReadValue<Vector2>();
}
public void OnScroll(InputAction.CallbackContext context)
{
ScrollInput = context.ReadValue<Vector2>();
}
public void OnSprint(InputAction.CallbackContext context)
{
if (context.performed)
{
IsSprintHeld = true;
OnSprintEvent?.Invoke();
}
if (context.canceled) IsSprintHeld = false;
}
public void OnToggleView(InputAction.CallbackContext context)
{
if (context.performed)
{
Debug.Log("[InputReader] ToggleView Action Performed!");
wasToggleViewPressed = true;
OnToggleViewEvent?.Invoke();
}
}
public void OnJump(InputAction.CallbackContext context)
{
if (context.performed)
{
wasJumpPressed = true;
OnJumpEvent?.Invoke();
}
}
public bool ConsumeJumpInput()
{
bool val = wasJumpPressed;
wasJumpPressed = false;
return val;
}
public void OnDodgeOrThrust(InputAction.CallbackContext context)
{
if (context.performed)
{
wasDodgePressed = true;
OnDodgeEvent?.Invoke();
}
}
public void OnCrouch(InputAction.CallbackContext context)
{
if (context.performed)
{
wasCrouchPressed = true;
OnCrouchEvent?.Invoke();
}
}
public void OnInteract(InputAction.CallbackContext context)
{
if (context.performed)
{
wasInteractPressed = true;
IsInteractHeld = true;
OnInteractEvent?.Invoke();
}
if (context.canceled)
{
IsInteractHeld = false;
}
}
public void OnNext(InputAction.CallbackContext context)
{
if (context.performed)
{
wasNextPressed = true;
OnNextInteractEvent?.Invoke();
}
}
public void OnPrevious(InputAction.CallbackContext context)
{
if (context.performed)
{
wasPreviousPressed = true;
OnPreviousInteractEvent?.Invoke();
}
}
// UI Callbacks
public void OnToggleSettings(InputAction.CallbackContext context)
{
if (context.performed)
{
Debug.Log("[InputReader] Toggle Settings Action Performed!");
OnToggleSettingsEvent?.Invoke();
}
}
public void OnCancel(InputAction.CallbackContext context)
{
if (context.performed)
{
Debug.Log("[InputReader] Cancel Action Performed (ESC)!");
OnCancelEvent?.Invoke();
}
}
public void OnAim(InputAction.CallbackContext context)
{
if (context.performed) IsAimHeld = true;
if (context.canceled)
{
IsAimHeld = false;
wasAimReleased = true;
}
}
public void OnBlock(InputAction.CallbackContext context)
{
if (context.performed) IsBlockHeld = true;
if (context.canceled) IsBlockHeld = false;
}
public void OnStrongAttack(InputAction.CallbackContext context)
{
if (context.performed)
{
wasStrongAttackPressed = true;
OnStrongAttackEvent?.Invoke();
}
}
public void OnReload(InputAction.CallbackContext context)
{
if (context.performed)
{
wasReloadPressed = true;
OnReloadEvent?.Invoke();
}
}
public void OnSwitchSide(InputAction.CallbackContext context)
{
if (context.performed)
{
wasSwitchSidePressed = true;
OnSwitchSideEvent?.Invoke();
}
}
public void OnScopeView(InputAction.CallbackContext context)
{
if (context.performed)
{
wasScopeViewPressed = true;
IsScopeViewHeld = true;
OnScopeViewEvent?.Invoke();
}
if (context.canceled)
{
IsScopeViewHeld = false;
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5962d8f2c8e40e240a4a4907c7b539fa

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c00a96cb2611f4c419de81de31da6cda
guid: 48709b0e657673f43b9175666f7d90d6
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a9230142ad8a58a4ab9dd5d136a7dd21
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,371 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &372682534
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 372682537}
- component: {fileID: 372682536}
- component: {fileID: 372682535}
- component: {fileID: 372682538}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &372682535
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372682534}
m_Enabled: 1
--- !u!20 &372682536
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372682534}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, 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 &372682537
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372682534}
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 &372682538
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372682534}
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!1 &1271353357
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1271353360}
- component: {fileID: 1271353359}
- component: {fileID: 1271353358}
m_Layer: 0
m_Name: Read Me
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!102 &1271353358
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271353357}
m_Text: 'Read the text file "Read Me First [About the Example - Demos].txt"
before
you open the example/demo packages.'
m_OffsetZ: 0
m_CharacterSize: 1
m_LineSpacing: 1
m_Anchor: 0
m_Alignment: 0
m_TabSize: 4
m_FontSize: 0
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!23 &1271353359
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271353357}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!4 &1271353360
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1271353357}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -19.23, y: 1.83, z: 12.29}
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!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 372682537}
- {fileID: 1271353360}

View File

@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 773d26e688e03024298a2a369cdcd1fe
TextScriptImporter:
guid: 62515c27a4e5faa44840ab5658f1e4a4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName: