This commit is contained in:
emDuy
2026-06-18 01:27:38 +07:00
13 changed files with 36103 additions and 202 deletions

View File

@@ -5,10 +5,42 @@
</component>
<component name="ChangeListManager">
<list default="true" id="d308d1cb-09fc-4331-ba20-00f7b43d1576" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/indexLayout.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Third Parties/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/FirstPersonScope.renderTexture" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Third Parties/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/FirstPersonScope.renderTexture" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Third Parties/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/ThirdPersonScope.renderTexture" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Third Parties/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/ThirdPersonScope.renderTexture" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Demo.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Demo.unity" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Items/Shooter/AssaultRifle/MuzzleFlash.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Items/Shooter/AssaultRifle/MuzzleFlash.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Black.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Black.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Blue.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Blue.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/BlueEmissive.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/BlueEmissive.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Car/SkyCarBodyGrey.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Car/SkyCarBodyGrey.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Car/SkyCarWheelGrey.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Car/SkyCarWheelGrey.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/DarkBlue.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/DarkBlue.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Exterior/ExteriorDarkGrid.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Exterior/ExteriorDarkGrid.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/IndoorSphereEmissive.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/IndoorSphereEmissive.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/FastTimeOrbInner.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/FastTimeOrbInner.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/FastTimeOrbOuter.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/FastTimeOrbOuter.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/SlowTimeOrbInner.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/SlowTimeOrbInner.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/SlowTimeOrbOuter.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Materials/Scene/Props/SlowTimeOrbOuter.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/FirstPersonScope.renderTexture" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/FirstPersonScope.renderTexture" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/ThirdPersonScope.renderTexture" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Opsive/UltimateCharacterController/Demo/Textures/Items/Shooter/AssaultRifle/ThirdPersonScope.renderTexture" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenUpgradeManager.XML.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Plugins/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Resources/DOTweenSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Resources/DOTweenSettings.asset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Camera/Prototype/CameraController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Camera/Prototype/CameraController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Camera/Prototype/CameraOcclusionTransparency.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Camera/Prototype/CameraOcclusionTransparency.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Camera/Prototype/CameraRotationHandler.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Camera/Prototype/CameraRotationHandler.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/BaseUIController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/BaseUIController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/HUDController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/HUDController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/LoginController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/LoginController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/MainMenuController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/MainMenuController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/SettingsController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/SettingsController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/UIManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/UIManager.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/TEST CUA TUAN/Free Wood Door Pack/Materials/Door_1_Materials/Door_1_Black.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/TEST CUA TUAN/Free Wood Door Pack/Materials/Door_1_Materials/Door_1_Black.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/TEST CUA TUAN/Free Wood Door Pack/Materials/Door_Knob_Material/Copper.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/TEST CUA TUAN/Free Wood Door Pack/Materials/Door_Knob_Material/Copper.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Packages/manifest.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/manifest.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Packages/packages-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/packages-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ProjectSettings/ProjectSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/ProjectSettings.asset" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -17,12 +49,12 @@
</component>
<component name="EmbeddingIndexingInfo">
<option name="cachedIndexableFilesCount" value="6" />
<option name="fileBasedEmbeddingIndicesEnabled" value="true" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/.gemini-pool.json" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Game/EloData.cs.meta" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Game/MatchEloManager.cs.meta" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/MazeManager.cs.meta" root0="FORCE_HIGHLIGHTING" />
@@ -31,65 +63,6 @@
<commands />
<urls />
</component>
<component name="NextEditCompletionFeaturesState">
<decayedCancelled>
<entry key="MS100" value="1.6373746085550898" />
<entry key="MS500" value="3.2323276832908823" />
<entry key="S2" value="5.734128875256362" />
<entry key="S5" value="9.692334628804957" />
<entry key="S10" value="15.372719000009218" />
<entry key="S30" value="27.25587333496252" />
<entry key="S60" value="33.582194130747595" />
<entry key="M2" value="37.802323333194906" />
<entry key="M5" value="40.78697318561033" />
<entry key="M10" value="41.86958983658713" />
<entry key="M15" value="42.24095920696704" />
<entry key="M30" value="42.617730949019766" />
<entry key="H1" value="42.808172306519566" />
<entry key="H2" value="42.90391210445303" />
<entry key="H4" value="42.95191244502936" />
<entry key="D1" value="42.99197934286843" />
<entry key="W1" value="42.998854043211146" />
</decayedCancelled>
<decayedSelected>
<entry key="MS100" value="0.0" />
<entry key="MS500" value="0.0" />
<entry key="S2" value="0.0" />
<entry key="S5" value="0.0" />
<entry key="S10" value="0.0" />
<entry key="S30" value="0.0" />
<entry key="S60" value="0.0" />
<entry key="M2" value="0.0" />
<entry key="M5" value="0.0" />
<entry key="M10" value="0.0" />
<entry key="M15" value="0.0" />
<entry key="M30" value="0.0" />
<entry key="H1" value="0.0" />
<entry key="H2" value="0.0" />
<entry key="H4" value="0.0" />
<entry key="D1" value="0.0" />
<entry key="W1" value="0.0" />
</decayedSelected>
<decayedShown>
<entry key="MS100" value="1.446975191067906" />
<entry key="MS500" value="3.162131255018146" />
<entry key="S2" value="5.700971579731451" />
<entry key="S5" value="9.65965962382217" />
<entry key="S10" value="15.337023559433721" />
<entry key="S30" value="27.225359770508142" />
<entry key="S60" value="33.56067282856215" />
<entry key="M2" value="37.78927510426922" />
<entry key="M5" value="40.78107421397122" />
<entry key="M10" value="41.86651405631351" />
<entry key="M15" value="42.238879569741364" />
<entry key="M30" value="42.61667629992446" />
<entry key="H1" value="42.80764122248434" />
<entry key="H2" value="42.90364561600259" />
<entry key="H4" value="42.951778963370906" />
<entry key="D1" value="42.99195706287828" />
<entry key="W1" value="42.99885085954518" />
</decayedShown>
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 0
}</component>
@@ -104,12 +77,8 @@
&quot;RunOnceActivity.MCP Project settings loaded&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;,
&quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;RunOnceActivity.readMode.enableVisualFormatting&quot;: &quot;true&quot;,
&quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
&quot;cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;codeWithMe.voiceChat.enabledByDefault&quot;: &quot;false&quot;,
&quot;com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;junie.onboarding.icon.badge.shown&quot;: &quot;true&quot;,
@@ -118,14 +87,13 @@
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.general&quot;,
&quot;to.speed.mode.migration.done&quot;: &quot;true&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Start Unity" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="E:\APPDATA\6000.3.10f1\Editor\Unity.exe" />
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\6000.3.10f1\Editor\Unity.exe" />
<option name="PROGRAM_PARAMETERS" value="-projectPath D:\Learning_Progress\Projects\BABA_YAGA -debugCodeOptimization" />
<option name="WORKING_DIRECTORY" value="D:\Learning_Progress\Projects\BABA_YAGA" />
<option name="PASS_PARENT_ENVS" value="1" />
@@ -135,7 +103,7 @@
<method v="2" />
</configuration>
<configuration name="Unit Tests (batch mode)" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="E:\APPDATA\6000.3.10f1\Editor\Unity.exe" />
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\6000.3.10f1\Editor\Unity.exe" />
<option name="PROGRAM_PARAMETERS" value="-runTests -batchmode -projectPath D:\Learning_Progress\Projects\BABA_YAGA -testResults Logs/results.xml -logFile Logs/Editor.log -testPlatform EditMode -debugCodeOptimization" />
<option name="WORKING_DIRECTORY" value="D:\Learning_Progress\Projects\BABA_YAGA" />
<option name="PASS_PARENT_ENVS" value="1" />
@@ -144,7 +112,7 @@
<option name="MIXED_MODE_DEBUG" value="0" />
<method v="2" />
</configuration>
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" useMixedMode="false">
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
<option name="allowRunningInParallel" value="false" />
<option name="listenPortForConnections" value="false" />
<option name="pid" />
@@ -155,6 +123,7 @@
<option name="selectedOptions">
<list />
</option>
<option name="useMixedMode" value="false" />
<method v="2" />
</configuration>
<configuration name="Attach to" type="UnityDevicePlayer" factoryName="UnityAttachToDevicePlayer">
@@ -175,11 +144,7 @@
<workItem from="1781015858277" duration="4448000" />
<workItem from="1781181289365" duration="2651000" />
<workItem from="1781412609976" duration="4823000" />
<workItem from="1781599612251" duration="8140000" />
<workItem from="1781617583814" duration="42000" />
<workItem from="1781624178023" duration="291000" />
<workItem from="1781626646797" duration="245000" />
<workItem from="1781626920683" duration="116000" />
<workItem from="1781578060019" duration="4632000" />
</task>
<servers />
</component>
@@ -214,8 +179,4 @@
</breakpoints>
</breakpoint-manager>
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

View File

@@ -135,6 +135,9 @@ namespace OnlyScove.Scripts
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
@@ -165,28 +168,28 @@ namespace OnlyScove.Scripts
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
// Player's horizontal rotation (body) follows mouse YAW
if (followTarget != null)
{
followTarget.rotation = rotationHandler.PlanarRotation; // Sync body to camera yaw
}
if (followTarget != null) followTarget.rotation = rotationHandler.PlanarRotation;
if (fpvTarget != null) fpvTarget.rotation = rotationHandler.CurrentRotation;
if (fpvTarget != null)
{
fpvTarget.rotation = rotationHandler.CurrentRotation; // Sync head/eyes to full camera rotation
}
transform.rotation = rotationHandler.CurrentRotation; // Set camera rotation from handler (which includes vertical)
transform.rotation = rotationHandler.CurrentRotation;
focusPosition = fpvTarget.position;
targetDistance = 0; // FPV has no distance to player
targetDistance = 0;
// Disable TPV-specific effects
characterFading.HandleCharacterFading(0); // Fully opaque character in FPV
occlusionTransparency.HandleTransparency(transform, fpvTarget.position); // Can still have occlusion transparency for environment in FPV
// 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
@@ -203,6 +206,23 @@ namespace OnlyScove.Scripts
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;
@@ -217,11 +237,14 @@ namespace OnlyScove.Scripts
t = Mathf.Clamp01(t); // Clamp t between 0 and 1
// Smoothly interpolate parameters during transition
if (_currentViewMode == CameraViewMode.ThirdPerson && _targetViewMode == CameraViewMode.FirstPerson)
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)
@@ -230,14 +253,18 @@ namespace OnlyScove.Scripts
}
// Interpolate position and rotation
transform.position = Vector3.Lerp(transform.position, fpvTarget.position, t);
transform.rotation = Quaternion.Slerp(transform.rotation, fpvTarget.rotation, t);
if (fpvTarget != null)
{
transform.position = Vector3.Lerp(transform.position, fpvTarget.position, t);
transform.rotation = Quaternion.Slerp(transform.rotation, fpvTarget.rotation, t);
}
}
else if (_currentViewMode == CameraViewMode.FirstPerson && _targetViewMode == CameraViewMode.ThirdPerson)
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)
@@ -245,19 +272,10 @@ namespace OnlyScove.Scripts
_currentViewMode = _targetViewMode;
Debug.Log($"[CameraController] View transition complete. Current mode: {_currentViewMode}");
_inTransition = false;
// Initialize rotation handler based on new view mode
if (_currentViewMode == CameraViewMode.FirstPerson && fpvTarget != null)
{
rotationHandler.InitializeFPV(fpvTarget); // Initialize FPV rotation handler
}
else
{
rotationHandler.Initialize(transform); // Initialize TPV rotation handler
}
// Ensure FOV is set correctly at the end of transition
// Ensure final values are set correctly
_cam.fieldOfView = (_currentViewMode == CameraViewMode.FirstPerson) ? fpvFOV : dynamicFOV.CurrentTpvBaseFOV;
_cam.nearClipPlane = (_currentViewMode == CameraViewMode.FirstPerson) ? 0.01f : 0.3f;
}
}

View File

@@ -23,6 +23,14 @@ namespace OnlyScove.Scripts
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))
@@ -46,7 +54,7 @@ namespace OnlyScove.Scripts
}
}
private void ResetLastRenderer()
public void ResetLastRenderer()
{
if (_lastFadedRenderer != null)
{

View File

@@ -36,8 +36,14 @@ namespace OnlyScove.Scripts
// New method to initialize rotation specifically for FPV
public void InitializeFPV(Transform fpvTargetTransform)
{
_rotationX = fpvTargetTransform.localEulerAngles.x; // Use local rotation for vertical angle in FPV
_rotationY = fpvTargetTransform.eulerAngles.y; // Use world rotation for horizontal angle
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
}

View File

@@ -3,6 +3,8 @@ using UnityEngine.UIElements;
using PrimeTween;
using System.Threading.Tasks;
using DG.Tweening;
using Tween = PrimeTween.Tween;
using Ease = PrimeTween.Ease;
namespace Hallucinate.UI
{

View File

@@ -3,6 +3,8 @@ using UnityEngine.UIElements;
using PrimeTween;
using System.Threading.Tasks;
using DG.Tweening;
using Tween = PrimeTween.Tween;
using Ease = PrimeTween.Ease;
namespace Hallucinate.UI
{

View File

@@ -3,6 +3,8 @@ using UnityEngine.UIElements;
using PrimeTween;
using System.Threading.Tasks;
using DG.Tweening;
using Tween = PrimeTween.Tween;
using Ease = PrimeTween.Ease;
namespace Hallucinate.UI
{

View File

@@ -2,7 +2,9 @@ using UnityEngine;
using UnityEngine.UIElements;
using PrimeTween;
using System.Threading.Tasks;
using DG.Tweening;
using Tween = PrimeTween.Tween;
using Ease = PrimeTween.Ease;
namespace Hallucinate.UI
{

View File

@@ -6,9 +6,12 @@ using System.Collections.Generic;
using System.Linq;
using System;
using System.Threading.Tasks;
using DG.Tweening;
using OnlyScove.Scripts;
using Hallucinate.Audio;
using PrimeTween;
using Tween = PrimeTween.Tween;
using Ease = PrimeTween.Ease;
namespace Hallucinate.UI
{

View File

@@ -5,6 +5,8 @@ using DG.Tweening;
using UnityEngine;
using UnityEngine.UIElements;
using PrimeTween;
using Tween = PrimeTween.Tween;
using Ease = PrimeTween.Ease;
using OnlyScove.Scripts;
#if UNITY_EDITOR
using UnityEditor;

View File

@@ -81,6 +81,6 @@ Material:
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _TintColor: {r: 1, g: 1, b: 1, a: 0}
- _TintColor: {r: 0, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -295,6 +295,103 @@ PlayerSettings:
androidSymbolsSizeThreshold: 800
m_BuildTargetIcons: []
m_BuildTargetPlatformIcons:
- m_BuildTarget: iPhone
m_Icons:
- m_Textures: []
m_Width: 180
m_Height: 180
m_Kind: 0
m_SubKind: iPhone
- m_Textures: []
m_Width: 120
m_Height: 120
m_Kind: 0
m_SubKind: iPhone
- m_Textures: []
m_Width: 167
m_Height: 167
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 152
m_Height: 152
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 76
m_Height: 76
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 120
m_Height: 120
m_Kind: 3
m_SubKind: iPhone
- m_Textures: []
m_Width: 80
m_Height: 80
m_Kind: 3
m_SubKind: iPhone
- m_Textures: []
m_Width: 80
m_Height: 80
m_Kind: 3
m_SubKind: iPad
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 3
m_SubKind: iPad
- m_Textures: []
m_Width: 87
m_Height: 87
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 58
m_Height: 58
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 29
m_Height: 29
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 58
m_Height: 58
m_Kind: 1
m_SubKind: iPad
- m_Textures: []
m_Width: 29
m_Height: 29
m_Kind: 1
m_SubKind: iPad
- m_Textures: []
m_Width: 60
m_Height: 60
m_Kind: 2
m_SubKind: iPhone
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 2
m_SubKind: iPhone
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 2
m_SubKind: iPad
- m_Textures: []
m_Width: 20
m_Height: 20
m_Kind: 2
m_SubKind: iPad
- m_Textures: []
m_Width: 1024
m_Height: 1024
m_Kind: 4
m_SubKind: App Store
- m_BuildTarget: Android
m_Icons:
- m_Textures: []
@@ -687,7 +784,7 @@ PlayerSettings:
PS4: DOTWEEN
PS5: DOTWEEN
QNX: DOTWEEN
Standalone: FUSION_WEAVER;FUSION2;FUSION_2;FUSION_2_0;FUSION_2_0_12;FUSION_2_OR_NEWER;FUSION_2_0_OR_NEWER;FUSION_LOGLEVEL_INFO;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;INVECTOR_MELEE;INVECTOR_SHOOTER;INVECTOR_BASIC;FIRST_PERSON_CONTROLLER;THIRD_PERSON_CONTROLLER;ULTIMATE_CHARACTER_CONTROLLER_SHOOTER;FIRST_PERSON_SHOOTER;ULTIMATE_CHARACTER_CONTROLLER_MELEE;FIRST_PERSON_MELEE;ULTIMATE_CHARACTER_CONTROLLER_UNIVERSALRP;DOTWEEN
Standalone: FUSION_WEAVER;FUSION2;FUSION_2;FUSION_2_0;FUSION_2_0_12;FUSION_2_OR_NEWER;FUSION_2_0_OR_NEWER;FUSION_LOGLEVEL_INFO;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;FIRST_PERSON_CONTROLLER;THIRD_PERSON_CONTROLLER;ULTIMATE_CHARACTER_CONTROLLER_SHOOTER;FIRST_PERSON_SHOOTER;ULTIMATE_CHARACTER_CONTROLLER_MELEE;FIRST_PERSON_MELEE;ULTIMATE_CHARACTER_CONTROLLER_UNIVERSALRP;INVECTOR_MELEE;INVECTOR_SHOOTER;INVECTOR_BASIC;DOTWEEN
VisionOS: DOTWEEN
WebGL: DOTWEEN
Windows Store Apps: DOTWEEN
@@ -791,11 +888,11 @@ PlayerSettings:
captureStartupLogs: {}
activeInputHandler: 2
windowsGamepadBackendHint: 0
cloudProjectId: f26666dc-3d28-4cad-b5dd-83af9e105972
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName: HALLUCINATE
organizationId: scov3
projectName:
organizationId:
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
hmiLoadingImage: {fileID: 0}