From 534c7ec3d397292ca46d269c77784ea067165f99 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Thu, 9 Jan 2025 16:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E7=89=A9=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FixSystemNew/Clinic/CharacterViewer.cs | 18 +++++++++++++++--- .../FixSystemNew/Clinic/ClinicSystem.cs | 12 ++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/FixSystemNew/Clinic/CharacterViewer.cs b/Assets/Scripts/FixSystemNew/Clinic/CharacterViewer.cs index 6245318a3..e8fadb6d4 100644 --- a/Assets/Scripts/FixSystemNew/Clinic/CharacterViewer.cs +++ b/Assets/Scripts/FixSystemNew/Clinic/CharacterViewer.cs @@ -62,6 +62,8 @@ namespace AibisDream.FixSystem yield return new WaitForSeconds(1); // 激活角色 _curCharacter.SetActive(true); + + characterData.isShow = false; UpdateCharacterData(); } @@ -101,8 +103,9 @@ namespace AibisDream.FixSystem { if (_curCharacter) { - _curCharacter.SetActive(true); yield return FadeCharacter(1, duration); + characterData.isShow = true; + UpdateCharacterData(); } } @@ -111,7 +114,8 @@ namespace AibisDream.FixSystem if (_curCharacter != null) { yield return FadeCharacter(0, duration); - _curCharacter.SetActive(false); + characterData.isShow = false; + UpdateCharacterData(); } } @@ -165,18 +169,24 @@ namespace AibisDream.FixSystem public void AddLinkDevice() { + characterData.hasDevice = true; + UpdateCharacterData(); LinkDevice.gameObject.SetActive(true); } public void RemoveLinkDevice() { + characterData.hasDevice = false; + UpdateCharacterData(); LinkDevice.gameObject.SetActive(false); } - public void CharacterShow(string characterName) + public void CharacterShow(string characterName = "") { if (_curCharacter != null) { + characterData.isShow = true; + UpdateCharacterData(); // 将角色的透明度设置为 1 SetCharacterAlpha(1); } @@ -198,5 +208,7 @@ namespace AibisDream.FixSystem public string characterName; public string faceName; public string poseName; + public bool hasDevice; + public bool isShow; } } \ No newline at end of file diff --git a/Assets/Scripts/FixSystemNew/Clinic/ClinicSystem.cs b/Assets/Scripts/FixSystemNew/Clinic/ClinicSystem.cs index dbf3915a0..b3527cc60 100644 --- a/Assets/Scripts/FixSystemNew/Clinic/ClinicSystem.cs +++ b/Assets/Scripts/FixSystemNew/Clinic/ClinicSystem.cs @@ -49,6 +49,16 @@ namespace AibisDream yield return character.CharacterInit(data.characterName); character.SwitchFace(data.faceName); character.SwitchPose(data.poseName); + if (data.isShow) character.CharacterShow(); + if (data.hasDevice) + { + character.AddLinkDevice(); + } + else + { + character.RemoveLinkDevice(); + } + } public IEnumerator Indoor(float duration) @@ -102,6 +112,8 @@ namespace AibisDream public string characterName; public string faceName; public string poseName; + public bool hasDevice; + public bool isShow; public event Action LoadEvent;