0.3.3.3 업데이트

This commit is contained in:
NTG_Lenovo 2024-11-05 17:26:26 +09:00
parent c5887fcbec
commit 10bf2d0638
6 changed files with 295 additions and 50 deletions

View File

@ -6626,6 +6626,7 @@ GameObject:
- component: {fileID: 545850351} - component: {fileID: 545850351}
- component: {fileID: 545850350} - component: {fileID: 545850350}
- component: {fileID: 545850349} - component: {fileID: 545850349}
- component: {fileID: 545850353}
m_Layer: 0 m_Layer: 0
m_Name: BaseCamera m_Name: BaseCamera
m_TagString: Untagged m_TagString: Untagged
@ -6642,7 +6643,7 @@ Transform:
m_GameObject: {fileID: 545850347} m_GameObject: {fileID: 545850347}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927}
m_LocalPosition: {x: 3.4, y: 5.499513, z: -13.202312} m_LocalPosition: {x: 1.11, y: 7.427876, z: -14.970446}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -6736,7 +6737,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 886251e9a18ece04ea8e61686c173e1b, type: 3} m_Script: {fileID: 11500000, guid: 886251e9a18ece04ea8e61686c173e1b, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
CameraDistance: 7 CameraDistance: 10
DeadZoneDepth: 0 DeadZoneDepth: 0
Composition: Composition:
ScreenPosition: {x: 0, y: 0} ScreenPosition: {x: 0, y: 0}
@ -6798,6 +6799,20 @@ MonoBehaviour:
BarrelClipping: 0.25 BarrelClipping: 0.25
Anamorphism: 0 Anamorphism: 0
BlendHint: 0 BlendHint: 0
--- !u!114 &545850353
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 545850347}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4d75924d76b05344aa410607bc57db98, type: 3}
m_Name:
m_EditorClassIdentifier:
BoundingVolume: {fileID: 1589932377}
SlowingDistance: 100
--- !u!1 &547484572 --- !u!1 &547484572
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -10701,7 +10716,7 @@ Transform:
m_GameObject: {fileID: 873223985} m_GameObject: {fileID: 873223985}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927}
m_LocalPosition: {x: 3.4, y: 5.499513, z: -13.202312} m_LocalPosition: {x: 1.46, y: 7.5424685, z: -15.107012}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@ -10728,7 +10743,13 @@ MonoBehaviour:
cameraLocation: {fileID: 1634548838} cameraLocation: {fileID: 1634548838}
<BaseCamera>k__BackingField: {fileID: 545850352} <BaseCamera>k__BackingField: {fileID: 545850352}
<StorageCamera>k__BackingField: {fileID: 613509651} <StorageCamera>k__BackingField: {fileID: 613509651}
_confinerCollider: {fileID: 1589932376}
_transparencySortAxis: {x: 0, y: 0, z: 0} _transparencySortAxis: {x: 0, y: 0, z: 0}
_cameraDistance: {x: 5, y: 10}
_zoomPower: 0.5
_zoomLerpSpeed: 5
_zoomOutConfinerScale: {x: 1, y: 1, z: 0}
_zoomInConfinerScale: {x: 10, y: 10, z: 10}
--- !u!1 &874445110 --- !u!1 &874445110
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -20178,6 +20199,114 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1584835730} m_GameObject: {fileID: 1584835730}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1589932375
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1589932376}
- component: {fileID: 1589932379}
- component: {fileID: 1589932378}
- component: {fileID: 1589932377}
m_Layer: 0
m_Name: ConfinerCollider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1589932376
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1589932375}
serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927}
m_LocalPosition: {x: 1.96, y: 7.67, z: -15}
m_LocalScale: {x: 1, y: 1, z: 0}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1634548838}
m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0}
--- !u!65 &1589932377
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1589932375}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0.25, z: 0.5}
--- !u!23 &1589932378
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1589932375}
m_Enabled: 0
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_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
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_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1589932379
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1589932375}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1599866058 --- !u!1 &1599866058
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -21028,6 +21157,7 @@ Transform:
m_Children: m_Children:
- {fileID: 545850348} - {fileID: 545850348}
- {fileID: 613509648} - {fileID: 613509648}
- {fileID: 1589932376}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1644722322 --- !u!1 &1644722322
@ -29183,7 +29313,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3} - target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 3.4 value: 1.11
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3} - target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
@ -29191,7 +29321,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3} - target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -7.84 value: -7.31
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3} - target: {fileID: 2798544366308408093, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
@ -30101,30 +30231,6 @@ PrefabInstance:
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0.32760355 value: 0.32760355
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_ActionEvents.Array.size
value: 31
objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_ActionEvents.Array.data[28].m_ActionId
value: ef02b0fe-8d61-4bdb-bd1e-543575b67aa0
objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_ActionEvents.Array.data[29].m_ActionId
value: c30fb3f3-d280-4b30-af6c-15f7483fd658
objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_ActionEvents.Array.data[28].m_ActionName
value: 'Tycoon/Manual[/Keyboard/q]'
objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_ActionEvents.Array.data[29].m_ActionName
value: 'TycoonUi/CancelManual[/Keyboard/q]'
objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_ActionEvents.Array.data[29].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnCancelManual
objectReference: {fileID: 0}
- target: {fileID: 6110939913361161778, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3} - target: {fileID: 6110939913361161778, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0.01015869 value: -0.01015869

View File

@ -125,12 +125,16 @@ namespace BlueWater.Players.Tycoons
} }
} }
public void OnManual(InputAction.CallbackContext context) public void OnZoomOut(InputAction.CallbackContext context)
{ {
if (context.performed) var value = context.ReadValue<float>();
{ EventManager.InvokeCameraZoomOut(value);
TycoonUiManager.Instance.ManualBook.Open(); }
}
public void OnZoomIn(InputAction.CallbackContext context)
{
var value = context.ReadValue<float>();
EventManager.InvokeCameraZoomIn(value);
} }
// TycoonUi // TycoonUi

View File

@ -19,6 +19,18 @@ namespace BlueWater
OnInitializedPlayerInput?.Invoke(); OnInitializedPlayerInput?.Invoke();
} }
public static Action<float> OnCameraZoomOut;
public static void InvokeCameraZoomOut(float value)
{
OnCameraZoomOut?.Invoke(value);
}
public static Action<float> OnCameraZoomIn;
public static void InvokeCameraZoomIn(float value)
{
OnCameraZoomIn?.Invoke(value);
}
// Ui // Ui
public static Action<float, float, Color?, float> OnFadeInOut; public static Action<float, float, Color?, float> OnFadeInOut;
public static void InvokeFadeInOut(float fadeInTime, float fadeOutTime, Color? fadeColor = null, float delayAfterFadeIn = 0f) public static void InvokeFadeInOut(float fadeInTime, float fadeOutTime, Color? fadeColor = null, float delayAfterFadeIn = 0f)

View File

@ -565,6 +565,24 @@
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": false "initialStateCheck": false
},
{
"name": "ZoomOut",
"type": "PassThrough",
"id": "58ceafb0-6793-42e9-8c85-5527c3b43147",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "ZoomIn",
"type": "PassThrough",
"id": "c8d0a703-f98c-41e5-9e7a-8639bf731c02",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
} }
], ],
"bindings": [ "bindings": [
@ -666,6 +684,28 @@
"action": "Manual", "action": "Manual",
"isComposite": false, "isComposite": false,
"isPartOfComposite": false "isPartOfComposite": false
},
{
"name": "",
"id": "a5a36bc9-6d49-4edf-bd81-4102e3389c1a",
"path": "<Mouse>/scroll/down",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "ZoomOut",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "8b527bcb-58c7-4d3a-9d3b-23cc833b2bbd",
"path": "<Mouse>/scroll/up",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "ZoomIn",
"isComposite": false,
"isPartOfComposite": false
} }
] ]
}, },

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using Unity.Cinemachine; using Unity.Cinemachine;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
namespace BlueWater namespace BlueWater
{ {
@ -36,13 +37,35 @@ namespace BlueWater
[field: SerializeField] [field: SerializeField]
public CinemachineCamera StorageCamera { get; private set; } public CinemachineCamera StorageCamera { get; private set; }
[SerializeField]
private Transform _confinerCollider;
[SerializeField] [SerializeField]
private Vector3 _transparencySortAxis; private Vector3 _transparencySortAxis;
[Title("줌")]
[SerializeField]
private Vector2 _cameraDistance = new(5f, 10f);
[SerializeField, Range(0.01f, 1f)]
private float _zoomPower = 0.5f;
[SerializeField, Range(1f, 10f)]
private float _zoomLerpSpeed = 5f;
[SerializeField]
private Vector3 _zoomOutConfinerScale = new(1f, 1f, 0f);
[SerializeField]
private Vector3 _zoomInConfinerScale = new(10f, 10f, 10f);
// Variables // Variables
private CinemachineBrain _cinemachineBrain; private CinemachineBrain _cinemachineBrain;
private CinemachinePositionComposer _baseCameraComposer;
private List<CinemachineCamera> _cinemachineCameras = new(); private List<CinemachineCamera> _cinemachineCameras = new();
private float _targetCameraDistance;
#endregion #endregion
// Unity events // Unity events
@ -60,13 +83,38 @@ namespace BlueWater
private void Start() private void Start()
{ {
_targetCameraDistance = _baseCameraComposer.CameraDistance;
EventManager.OnCameraZoomOut += ZoomOut;
EventManager.OnCameraZoomIn += ZoomIn;
if (!GameManager.Instance) return; if (!GameManager.Instance) return;
GameManager.Instance.OnInstantiatePlayer += SetFollow; GameManager.Instance.OnInstantiatePlayer += SetFollow;
} }
private void LateUpdate()
{
var lerpTime = Time.deltaTime * _zoomLerpSpeed;
_baseCameraComposer.CameraDistance = Mathf.Lerp(
_baseCameraComposer.CameraDistance,
_targetCameraDistance,
lerpTime
);
var normalizedT = (_baseCameraComposer.CameraDistance - _cameraDistance.x) / (_cameraDistance.y - _cameraDistance.x);
_confinerCollider.localScale = Vector3.Lerp(
_zoomInConfinerScale,
_zoomOutConfinerScale,
normalizedT
);
}
private void OnDestroy() private void OnDestroy()
{ {
EventManager.OnCameraZoomOut -= ZoomOut;
EventManager.OnCameraZoomIn -= ZoomIn;
if (!GameManager.Instance) return; if (!GameManager.Instance) return;
GameManager.Instance.OnInstantiatePlayer -= SetFollow; GameManager.Instance.OnInstantiatePlayer -= SetFollow;
@ -89,6 +137,8 @@ namespace BlueWater
BaseCamera = cameraLocation.Find("BaseCamera").GetComponent<CinemachineCamera>(); BaseCamera = cameraLocation.Find("BaseCamera").GetComponent<CinemachineCamera>();
StorageCamera = cameraLocation.Find("StorageCamera").GetComponent<CinemachineCamera>(); StorageCamera = cameraLocation.Find("StorageCamera").GetComponent<CinemachineCamera>();
_baseCameraComposer = BaseCamera.GetComponent<CinemachinePositionComposer>();
_cinemachineCameras.Add(BaseCamera); _cinemachineCameras.Add(BaseCamera);
_cinemachineCameras.Add(StorageCamera); _cinemachineCameras.Add(StorageCamera);
@ -105,12 +155,6 @@ namespace BlueWater
{ {
BaseCamera.Follow = target; BaseCamera.Follow = target;
} }
// public void SetFollowAndLookAt(Transform target)
// {
// BaseCombatCamera.Follow = target;
// BaseCombatCamera.LookAt = target;
// }
public void SetMainCamera(TycoonCameraType tycoonCameraType) public void SetMainCamera(TycoonCameraType tycoonCameraType)
{ {
@ -125,8 +169,7 @@ namespace BlueWater
{ {
element.Priority = 0; element.Priority = 0;
} }
//_cinemachineBrain.DefaultBlend.Style = styles;
newMainCamera.Priority = 1; newMainCamera.Priority = 1;
SetTransparencySortAxis(); SetTransparencySortAxis();
} }
@ -137,15 +180,23 @@ namespace BlueWater
camera.transparencySortMode = TransparencySortMode.CustomAxis; camera.transparencySortMode = TransparencySortMode.CustomAxis;
camera.transparencySortAxis = _transparencySortAxis; camera.transparencySortAxis = _transparencySortAxis;
} }
[Button("테스트용")]
private void Test()
{
var camera = Camera.main;
camera.transparencySortMode = TransparencySortMode.CustomAxis;
camera.transparencySortAxis = new Vector3(0, Mathf.Sin(Mathf.Deg2Rad * 40), Mathf.Cos(Mathf.Deg2Rad * 40));
}
public void ZoomOut(float value)
{
_targetCameraDistance = Mathf.Min(
_targetCameraDistance + value * _zoomPower,
_cameraDistance.y
);
}
public void ZoomIn(float value)
{
_targetCameraDistance = Mathf.Max(
_targetCameraDistance - value * _zoomPower,
_cameraDistance.x
);
}
#endregion #endregion
} }
} }

View File

@ -557,6 +557,38 @@ MonoBehaviour:
m_CallState: 2 m_CallState: 2
m_ActionId: 34c447c4-c69f-4348-89ba-e1f8585deb95 m_ActionId: 34c447c4-c69f-4348-89ba-e1f8585deb95
m_ActionName: 'Tycoon/Dash[/Keyboard/space]' m_ActionName: 'Tycoon/Dash[/Keyboard/space]'
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1674052485383758547}
m_TargetAssemblyTypeName: BlueWater.Players.Tycoons.TycoonInput, Assembly-CSharp
m_MethodName: OnZoomOut
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: 58ceafb0-6793-42e9-8c85-5527c3b43147
m_ActionName: 'Tycoon/ZoomOut[/Mouse/scroll/down]'
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1674052485383758547}
m_TargetAssemblyTypeName: BlueWater.Players.Tycoons.TycoonInput, Assembly-CSharp
m_MethodName: OnZoomIn
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: c8d0a703-f98c-41e5-9e7a-8639bf731c02
m_ActionName: 'Tycoon/ZoomIn[/Mouse/scroll/up]'
m_NeverAutoSwitchControlSchemes: 0 m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme: m_DefaultControlScheme:
m_DefaultActionMap: Tycoon m_DefaultActionMap: Tycoon