mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 05:27:13 +08:00
(client) feat:支持定义实体的碰撞体大小和偏移;建筑支持定义实体建筑和瓦片建筑,建筑支持指定按钮回调;添加存档管理器;Dev支持设置是否暂停;实体允许定义事件组;添加基地界面 (#57)
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/57
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
// Setting.cs
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Base
|
||||
{
|
||||
|
||||
|
||||
public class Setting : Utils.Singleton<Setting>
|
||||
{
|
||||
// 游戏设置数据类(用于序列化)
|
||||
@@ -13,7 +12,7 @@ namespace Base
|
||||
{
|
||||
public float progressStepDuration = 0.5f;
|
||||
public float exitAnimationDuration = 1f;
|
||||
public bool developerMode = false;
|
||||
public bool developerMode = false; // 默认值仍为 false,在编辑器中会被覆盖
|
||||
public bool friendlyFire = false;
|
||||
public bool showMiniMap = true;
|
||||
public float globalVolume = 1.0f;
|
||||
@@ -58,6 +57,7 @@ namespace Base
|
||||
PlayerPrefs.SetString("GameSettings", json);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
|
||||
public void LoadSettings()
|
||||
{
|
||||
if (PlayerPrefs.HasKey("GameSettings"))
|
||||
@@ -66,6 +66,10 @@ namespace Base
|
||||
CurrentSettings = JsonConvert.DeserializeObject<GameSettings>(json);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
CurrentSettings.developerMode = true;
|
||||
#endif
|
||||
|
||||
// 应用加载的设置
|
||||
ApplyAudioSettings();
|
||||
ApplyWindowSettings();
|
||||
@@ -76,6 +80,7 @@ namespace Base
|
||||
ApplyAudioSettings();
|
||||
ApplyWindowSettings();
|
||||
}
|
||||
|
||||
// 应用音频设置
|
||||
private void ApplyAudioSettings()
|
||||
{
|
||||
@@ -99,4 +104,4 @@ namespace Base
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user