This commit is contained in:
SweetJJuya 2024-10-31 21:17:10 +09:00
parent b6182e8d0a
commit e549e19ab7
16 changed files with 5076 additions and 11 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2997aa81c0ec30a4282900ffaacaba5c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -5341,12 +5341,12 @@ MonoBehaviour:
m_ActionName: 'Combat/HealthPointMax[/Keyboard/f3]'
- m_PersistentCalls:
m_Calls: []
m_ActionId: b02d861a-39ed-4c5e-abd0-7ce3c2a44707
m_ActionName: 'Bar/Pour[/Keyboard/space]'
m_ActionId: ef02b0fe-8d61-4bdb-bd1e-543575b67aa0
m_ActionName: 'Tycoon/Manual[/Keyboard/q]'
- m_PersistentCalls:
m_Calls: []
m_ActionId: 4752dd64-7a31-42ae-bfc9-45a01927bd07
m_ActionName: 'Bar/EscapeBar[/Keyboard/escape]'
m_ActionId: c30fb3f3-d280-4b30-af6c-15f7483fd658
m_ActionName: 'TycoonUi/CancelManual[/Keyboard/q]'
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: CombatTitle

View File

@ -184,19 +184,26 @@ namespace BlueWater.Audios
return enumerator.Current;
}
/// <summary>
/// 0.0001 ~ 1값
/// </summary>
/// <param name="volume"></param>
public void SetMasterVolume(float volume)
{
_audioMixer.SetFloat("Master", volume);
var newVolume = Mathf.Log10(volume) * 20f;
_audioMixer.SetFloat("Master", newVolume);
}
public void SetBgmVolume(float volume)
{
_audioMixer.SetFloat("Bgm", volume);
var newVolume = Mathf.Log10(volume) * 20f;
_audioMixer.SetFloat("Bgm", newVolume);
}
public void SetSfxVolume(float volume)
{
_audioMixer.SetFloat("Sfx", volume);
var newVolume = Mathf.Log10(volume) * 20f;
_audioMixer.SetFloat("Sfx", newVolume);
}
public void SetPitchSfxAll(float pitch)

View File

@ -1,3 +1,5 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
@ -18,7 +20,47 @@ namespace BlueWater
{
[SerializeField]
private PlayerInput _currentPlayerInput;
private Vector3 _lastMousePosition; //마우스 이동 감지용
private bool _isKey = false; //키보드 입력상태 == true / 마우스 입력상태 == false (중복 방직용)
private readonly List<Action> _onActionKeyboard = new List<Action>();
private readonly List<Action> _onActionMouse = new List<Action>();
public void AddOnActionKeyboard(Action action)
{
_onActionKeyboard.Add(action);
}
public void AddOnActionMouse(Action action)
{
_onActionMouse.Add(action);
}
public void Update()
{
bool CheckMouse(){return Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)||Input.GetMouseButtonDown(2);}
if(!_isKey && Input.anyKeyDown && !CheckMouse()) //키보드 감지 (최초)
{
foreach (var element in _onActionKeyboard)
{
element?.Invoke();
}
_lastMousePosition = Input.mousePosition;
_isKey = true;
}
else if (_isKey && (Input.anyKeyDown && CheckMouse() || (_isKey && Input.mousePosition != _lastMousePosition))) //마우스 감지 (최초)
{
foreach (var element in _onActionMouse)
{
element?.Invoke();
}
_lastMousePosition = Input.mousePosition;
_isKey = false;
}
}
/// <summary>
/// 현재 실행되고 있는 PlayerInput을 관리할 수 있게
/// PlayerInput 컴포넌트를 받아와서 사용하는 경우에 필수로 호출

View File

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

View File

@ -0,0 +1,53 @@
using BlueWater.Audios;
using UnityEngine;
using UnityEngine.UI;
public class TitleSetting : MonoBehaviour
{
[SerializeField]
private Slider _masterVolume;
[SerializeField]
private Slider _bgmVolume;
[SerializeField]
private Slider _sfxVolume;
private AudioManager _audioManager;
// Start is called once before the first execution of Update after the MonoBehaviour is created
private void Start()
{
_audioManager = AudioManager.Instance;
var masterVolume = ES3.Load("MasterVolume", 0f);
SetMasterVolume(masterVolume);
var bgmVolume = ES3.Load("BgmVolume", 0f);
SetBgmVolume(bgmVolume);
var sfxVolume = ES3.Load("SfxVolume", 0f);
SetSfxVolume(sfxVolume);
}
public void SetMasterVolume(float value)
{
_audioManager.SetMasterVolume(value);
_masterVolume.value = value;
ES3.Save("MasterVolume", value);
}
public void SetBgmVolume(float value)
{
_audioManager.SetBgmVolume(value);
_bgmVolume.value = value;
ES3.Save("BgmVolume", value);
}
public void SetSfxVolume(float value)
{
_audioManager.SetSfxVolume(value);
_sfxVolume.value = value;
ES3.Save("SfxVolume", value);
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5275bc06beecec943b6d5e7aa54d58e4

View File

@ -1,6 +1,9 @@
using System;
using System.Collections;
using BlueWater.Audios;
using Sirenix.OdinInspector;
using TMPro;
using Unity.VisualScripting;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
@ -16,15 +19,26 @@ namespace BlueWater.Titles
[SerializeField]
private Button _startGameButton;
[SerializeField]
private Button _settingButton;
[SerializeField]
private Button _exitButton;
private bool onButtonClicked = false;
[SerializeField]
private TMP_Text _versionText;
[SerializeField]
private string _dailyBgm = "DailyBgm1";
private string _dailyBgm = "DailyBgm1";
private bool _isQuitting;
private bool _isKey = false;
private bool _isQuitting;
[SerializeField]
private PlayerInputKeyManager _keyManager;
private void Awake()
{
InitializeComponents();
@ -32,8 +46,36 @@ namespace BlueWater.Titles
private void Start()
{
StartCoroutine(nameof(Initialize));
AudioManager.Instance.PlayBgm(_dailyBgm);
_startGameButton.onClick.AddListener(SceneController.Instance.FadeIn);
_startGameButton.onClick.AddListener(() => { onButtonClicked = true; });
_settingButton.onClick.AddListener(() => { onButtonClicked = true; });
_exitButton.onClick.AddListener(() => { onButtonClicked = true; });
_keyManager.AddOnActionKeyboard(OnKeyboard);
_keyManager.AddOnActionMouse(OnMouse);
//
//if(!onButtonClicked) ;
}
private void OnKeyboard()
{
Debug.Log("Keyboard");
EventSystem.current.SetSelectedGameObject(_startGameButton.gameObject);
}
private void OnMouse()
{
Debug.Log("Mouse");
if (!onButtonClicked)
{
EventSystem.current.SetSelectedGameObject(null);
}
}
private void OnApplicationQuit()
@ -57,6 +99,16 @@ namespace BlueWater.Titles
_versionText.text = GetVersion();
}
private IEnumerator Initialize()
{
PlayerInputKeyManager.Instance.SetCurrentPlayerInput(_playerInput);
yield return new WaitUntil(() => _playerInput.IsInitialized());
PlayerInputKeyManager.Instance.DisableAllActionMaps();
PlayerInputKeyManager.Instance.SwitchCurrentActionMap(InputActionMaps.CombatTitle);
EventManager.InvokeInitializedPlayerInput();
}
private string GetVersion()
{
#if UNITY_EDITOR

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 KiB

View File

@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: baf8fcda9fa4fbd41a9a8e32c8c61646
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 1024
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -124,3 +124,4 @@ Material:
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -124,3 +124,4 @@ Material:
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -139,3 +139,4 @@ Material:
- _V_CW_MainTex_Scroll: {r: 0, g: 0, b: 0, a: 0}
- _V_CW_Rim_Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1