Skip to content

Commit

Permalink
fix: 로비 카메라 애니메이터, 세팅 버그 수정 (#138)
Browse files Browse the repository at this point in the history
* 로비 카메라 애니메이터, 세팅 버그 수정

* 세팅 시스템 초기화 위치 변경
  • Loading branch information
jmJang00 authored May 12, 2024
1 parent 1c20a00 commit 17d5659
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 95 deletions.
145 changes: 87 additions & 58 deletions Client/Assets/Resources/Animators/MainMenuCam.controller
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-6624142252404462451
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MenuCamPos3
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 554183ff543835e46b57cea3826f7add, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-1142042278765322909
--- !u!1101 &-2685496814198394707
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
Expand All @@ -38,41 +12,46 @@ AnimatorStateTransition:
m_ConditionEvent: Animate
m_EventTreshold: 1.5
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6624142252404462451}
m_DstState: {fileID: -1449501113999140090}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_TransitionDuration: 0.4353953
m_TransitionOffset: 0.13194491
m_ExitTime: 0.09895815
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-293380974967498451
AnimatorStateTransition:
--- !u!1102 &-1449501113999140090
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102000013453325910}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.106870145
m_TransitionOffset: 1.6111782
m_ExitTime: 0.4124761
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
m_Name: MenuCamPos3
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 8885572229689420382}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 6549ca64e5ee42f4097f84cd17ceebcb, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -159,6 +138,9 @@ AnimatorStateTransition:
- m_ConditionMode: 3
m_ConditionEvent: Animate
m_EventTreshold: 0.5
- m_ConditionMode: 4
m_ConditionEvent: Animate
m_EventTreshold: 1.5
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102000010031421648}
m_Solo: 0
Expand Down Expand Up @@ -194,7 +176,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 93e2407eb9f8267479468b0f2bad5a92, type: 2}
m_Motion: {fileID: 7400000, guid: b76126072d190ec48a87cfb4172e4f3f, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
Expand All @@ -221,7 +203,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 554183ff543835e46b57cea3826f7add, type: 2}
m_Motion: {fileID: 7400000, guid: 31c7aa033cec5e24ea90edc627167f6c, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
Expand All @@ -239,7 +221,7 @@ AnimatorState:
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101000013721245820}
- {fileID: -1142042278765322909}
- {fileID: -2685496814198394707}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
Expand All @@ -249,7 +231,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: b857540e8056b244e9c1d9a8041510e4, type: 2}
m_Motion: {fileID: 7400000, guid: eb72f659061cffd4caf5d758b94036c0, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
Expand All @@ -266,16 +248,16 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102000010031421648}
m_Position: {x: 276, y: -12, z: 0}
m_Position: {x: 490, y: -110, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102000011105936396}
m_Position: {x: 516, y: 84, z: 0}
m_Position: {x: 670, y: 40, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102000013453325910}
m_Position: {x: 312, y: 192, z: 0}
m_Position: {x: 310, y: 190, z: 0}
- serializedVersion: 1
m_State: {fileID: -6624142252404462451}
m_Position: {x: 520, y: 320, z: 0}
m_State: {fileID: -1449501113999140090}
m_Position: {x: 250, y: 20, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
Expand All @@ -286,3 +268,50 @@ AnimatorStateMachine:
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102000013453325910}
--- !u!1101 &1697246389782148823
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102000013453325910}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.106870145
m_TransitionOffset: 1.6111782
m_ExitTime: 0.4124761
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &8885572229689420382
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: Animate
m_EventTreshold: 0.5
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102000013453325910}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.6589347
m_TransitionOffset: 0.1684708
m_ExitTime: 0.22462754
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Client/Assets/Scenes/LobbyScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ Animator:
m_GameObject: {fileID: 5078972249827746027}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: e1270baf4fb10bc43b7694b66604eb68, type: 2}
m_Controller: {fileID: 9100000, guid: 86a9aab867c8a2b46a9ab680fc2d94a5, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
Expand Down
6 changes: 2 additions & 4 deletions Client/Assets/Scripts/Contents/Cameras/CreatureCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public void UpdateCameraAngle()
}

// 마우스 입력을 받아와 회전 각도 계산
//float mouseX = Input.GetAxis("Mouse X") * PlayerPrefs.GetFloat("XSensitivity", 1.0f);
//float mouseY = Input.GetAxis("Mouse Y") * PlayerPrefs.GetFloat("YSensitivity", 1.0f);
float mouseX = Input.GetAxis("Mouse X");
float mouseY = Input.GetAxis("Mouse Y");
float mouseX = Input.GetAxis("Mouse X") * Managers.GameMng.SettingSystem.XSensitivity;
float mouseY = Input.GetAxis("Mouse Y") * Managers.GameMng.SettingSystem.YSensitivity;
CurrentAngle += mouseX * MouseSensitivity; //좌우 회전 값 계산
XRotation -= mouseY * MouseSensitivity; // 상하 회전 값 계산

Expand Down
6 changes: 5 additions & 1 deletion Client/Assets/Scripts/Scenes/GameScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,29 @@ protected override void Init()
SceneType = Define.SceneType.GameScene;

Managers.SoundMng.Play($"{Define.BGM_PATH}/Tone Hum", Define.SoundType.Bgm, volume:1f);

SettingSystem settingSystem = FindObjectOfType<SettingSystem>();
settingSystem.Init();
}

public override IEnumerator OnPlayerSpawn()
{
MapSystem mapSystem = null;
PlanSystem planSystem = null;
GameEndSystem gameEndSystem = null;

while (mapSystem == null || planSystem == null)
{
mapSystem = FindObjectOfType<MapSystem>();
planSystem = FindObjectOfType<PlanSystem>();
gameEndSystem = FindObjectOfType<GameEndSystem>();

yield return new WaitForSeconds(0.5f);
}
mapSystem.Init();
planSystem.Init();
gameEndSystem.Init();


UI_Ingame ingameUI = Managers.ObjectMng.MyCreature is Crew ? Managers.UIMng.ShowSceneUI<UI_CrewIngame>() : Managers.UIMng.ShowSceneUI<UI_AlienIngame>();
yield return new WaitUntil(() => ingameUI.Init());

Expand Down
3 changes: 3 additions & 0 deletions Client/Assets/Scripts/Scenes/ReadyScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ protected override void Init()
Managers.UIMng.ShowPopupUI<UI_StartGame>(parent: Managers.UIMng.Root.transform);

StartCoroutine(Managers.StartMng.TryStartGame());

SettingSystem settingSystem = FindAnyObjectByType<SettingSystem>();
settingSystem.Init();
}

public override IEnumerator OnPlayerSpawn()
Expand Down
1 change: 0 additions & 1 deletion Client/Assets/Scripts/Systems/PlayerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public enum PlayState
public override void Spawned()
{
DontDestroyOnLoad(gameObject);
CurrentPlayState = PlayState.Ready;
}

public void OnReadyCountChanged()
Expand Down
33 changes: 16 additions & 17 deletions Client/Assets/Scripts/Systems/SettingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,36 @@ public class SettingSystem : MonoBehaviour
public float XSensitivity = 1.0f;
public float YSensitivity = 1.0f;
private int _quality = 1;
public int VSycn = 0;
public int Quality
{
get { return _quality; }
set
{
PlayerPrefs.SetInt("Textures", 1);
QualitySettings.SetQualityLevel(1);
PlayerPrefs.SetInt("Textures", value);
QualitySettings.SetQualityLevel(value);
_quality = value;
}
}

enum Options
{

}

public void Init()
{
Managers.GameMng.SettingSystem = this;

XSensitivity = PlayerPrefs.GetFloat("XSensitivity", 1.0f);
YSensitivity = PlayerPrefs.GetFloat("YSensitivity", 1.0f);
}

void Update()
{
if (Quality != PlayerPrefs.GetInt("Textures"))
{
QualitySettings.SetQualityLevel(Quality);
}

Screen.SetResolution(Width, Height, Fullscreen);
Width = PlayerPrefs.GetInt("ScreenWidth", 1920);
Height = PlayerPrefs.GetInt("ScreenHeight", 1080);
Quality = PlayerPrefs.GetInt("Textures", 1);
VSycn = PlayerPrefs.GetInt("VSycn", 0);
}

public void SetResolution(int width, int height)
{
Width = width;
Height = height;
PlayerPrefs.SetFloat("ScreenWidth", width);
PlayerPrefs.SetFloat("ScreenHeight", height);
Screen.SetResolution(Width, Height, Fullscreen);
}

Expand All @@ -65,4 +57,11 @@ public void SetSensitivity(float sliderValueXSensitivity, float sliderValueYSens
PlayerPrefs.SetFloat("XSensitivity", sliderValueXSensitivity);
PlayerPrefs.SetFloat("YSensitivity", sliderValueYSensitivity);
}

public void SetVSync(int vsync)
{
VSycn = vsync;
PlayerPrefs.SetInt("VSycn", vsync);
QualitySettings.vSyncCount = vsync;
}
}
Loading

0 comments on commit 17d5659

Please sign in to comment.