public void Show(Item item, int itemActionID, bool pooled, UltimateCharacterLocomotion characterLocomotion)
{
...
m_Color.a = m_StartAlpha; // <=== set m_Color.a
...
// The muzzle flash may be inactive if the object isn't pooled.
if (!m_Pooled) {
m_GameObject.SetActive(true); // <=== enable GameObject
}
}
private void OnEnable()
{
m_Color.a = 0; // <=== reset m_Color.a to 0
...
}
private void Update()
{
if (m_Color.a > 0) { // <=== m_Color.a == 0 at the first frame cause OnEnable resets it
...
}
} else {
if (m_Pooled) {
...
} else {
m_GameObject.SetActive(false); // <=== disable GameObject
}
}
}