修复bug
This commit is contained in:
@@ -3,6 +3,7 @@ using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
using Cinemachine;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
@@ -12,7 +13,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
#region 内部索引
|
||||
|
||||
public BodyModule[] BodyModules { get; private set; }
|
||||
public List<BodyModule> BodyModules { get; private set; }
|
||||
public CableSystem CableSystem { get; private set; }
|
||||
public GameObject bodyModulePrefab;
|
||||
[HideInInspector] public Transform bodyModuleGroup;
|
||||
@@ -56,7 +57,7 @@ namespace AibisDream.FixSystem
|
||||
private void InitComponentRefs()
|
||||
{
|
||||
// 处理内部索引
|
||||
BodyModules = transform.GetComponentsInChildren<BodyModule>();
|
||||
BodyModules = transform.GetComponentsInChildren<BodyModule>().ToList();
|
||||
CableSystem = transform.Find("Cable System").GetComponent<CableSystem>();
|
||||
bodyModuleGroup = transform.Find("Body Module Group");
|
||||
oscilloscopeSystem = transform.Find("Oscilloscope System").GetComponent<OscilloscopeSystem>();
|
||||
@@ -251,7 +252,7 @@ namespace AibisDream.FixSystem
|
||||
newModules[i] = newModule;
|
||||
}
|
||||
|
||||
BodyModules = newModules;
|
||||
BodyModules = newModules.ToList();
|
||||
}
|
||||
|
||||
public override void SaveLevel()
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace AibisDream
|
||||
{
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").transform.GetComponent<UFModule>();
|
||||
_UFModule.RemoveUFModule();
|
||||
BodyModuleSystem.FindBodyModuleByName("UF").SetSocketAvailable(false);
|
||||
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_RemoveUFCover")]
|
||||
@@ -55,6 +57,7 @@ namespace AibisDream
|
||||
{
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").transform.GetComponent<UFModule>();
|
||||
_UFModule.InstallUFModule();
|
||||
BodyModuleSystem.FindBodyModuleByName("UF").SetSocketAvailable(true);
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_InstallUFCover")]
|
||||
|
||||
@@ -2,12 +2,15 @@ using UnityEngine;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream;
|
||||
using System;
|
||||
using AibisDream.FixSystem;
|
||||
|
||||
public class UFModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _ufCover;
|
||||
private GameObject _ufModule;
|
||||
|
||||
private GameObject _ufSocket;
|
||||
|
||||
private GameObject _ufColor;
|
||||
private UFData _ufData=new ();
|
||||
|
||||
@@ -18,6 +21,7 @@ public class UFModule : MonoBehaviour
|
||||
// 添加加载逻辑
|
||||
_ufData.LoadEvent += LoadData;
|
||||
_ufModule = transform.Find("Module Pic").gameObject;
|
||||
_ufSocket = transform.Find("Socket").gameObject;
|
||||
_ufCover = _ufModule.transform.Find("Cover").gameObject;
|
||||
_ufColor=_ufModule.transform.Find("Color").gameObject;
|
||||
}
|
||||
@@ -38,6 +42,8 @@ public class UFModule : MonoBehaviour
|
||||
if (_ufModule.activeInHierarchy)
|
||||
{
|
||||
_ufModule.SetActive(false);
|
||||
_ufSocket.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
_ufData.isUFRemoved = true;
|
||||
@@ -58,6 +64,7 @@ public class UFModule : MonoBehaviour
|
||||
if (!_ufModule.activeInHierarchy)
|
||||
{
|
||||
_ufModule.SetActive(true);
|
||||
_ufSocket.SetActive(true);
|
||||
}
|
||||
|
||||
_ufData.isUFRemoved = false;
|
||||
@@ -85,6 +92,7 @@ public class UFModule : MonoBehaviour
|
||||
public void UFinit()
|
||||
{
|
||||
_ufModule.SetActive(!_ufData.isUFRemoved);
|
||||
_ufSocket.SetActive(!_ufData.isUFRemoved);
|
||||
_ufCover.SetActive(!_ufData.isUFCoverRemoved);
|
||||
_ufColor.SetActive(!_ufData.isColorRemoved);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user