File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Demo/API_V2/Assets/Scripts Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ private void Start()
78
78
}
79
79
80
80
// 清除详情信息
81
- private void ClearDetails ( )
81
+ public void ClearDetails ( )
82
82
{
83
83
// 销毁详情信息
84
84
Destroy ( _details ) ;
@@ -105,7 +105,7 @@ private void ClearDetails()
105
105
// 初始化详情信息
106
106
public void Init ( EntrySO so )
107
107
{
108
- ClearDetails ( ) ;
108
+ // ClearDetails();
109
109
entrySO = so ;
110
110
111
111
titleText . text = so . entryName ;
Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ private void Start()
91
91
// 切换 MainCanvas 和 DetailsCanvas 的显示状态
92
92
public void SwitchCanvas ( )
93
93
{
94
+ if ( ! _isMainCanvasActive )
95
+ {
96
+ // 提前销毁时机 防止预期外的行为发生
97
+ detailsController . ClearDetails ( ) ;
98
+ }
94
99
_isMainCanvasActive = ! _isMainCanvasActive ;
95
100
mainCanvas . SetActive ( _isMainCanvasActive ) ;
96
101
detailsCanvas . SetActive ( ! _isMainCanvasActive ) ;
You can’t perform that action at this time.
0 commit comments