From b7a445554e3f57b5fe4b1f1c619d0bed022893b6 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 17 Sep 2021 00:13:31 +0800 Subject: + unit image effect handle --- Assets/Scripts/Unit/Components/UnitState/PCState.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Assets/Scripts/Unit/Components/UnitState/PCState.cs') diff --git a/Assets/Scripts/Unit/Components/UnitState/PCState.cs b/Assets/Scripts/Unit/Components/UnitState/PCState.cs index c7cab21c..eae1b370 100644 --- a/Assets/Scripts/Unit/Components/UnitState/PCState.cs +++ b/Assets/Scripts/Unit/Components/UnitState/PCState.cs @@ -78,9 +78,14 @@ public partial class PCState : UnitState LogHelper.LogError("缺少 " + methodFunc); } m_PrevState = m_State; - m_State = nextState; - - StartCoroutine(m_State.ToString(), param); + m_State = nextState; + + if(m_PrevState != m_State && owner.unitRender != null) + { + owner.unitRender.SetVisibilityInMainCamera(true); + } + + StartCoroutine(m_State.ToString(), param); } bool IsChange(EUnitState newState, bool bForce) -- cgit v1.1-26-g67d0