Exemple #1
0
 protected void Update()
 {
     // If the Soldier is respawning, make him fade away
     if (IsDead)
     {
         float newAlpha = Mathf.Max(0, (RespawnTime - (Time.time - m_deathTime)) / RespawnTime);
         Color newColor = new Color(Color.r, Color.g, Color.b, newAlpha);
         m_renderer.material.color = newColor;
         m_headController?.SetColor(newColor);
         m_gun?.SetColor(newColor);
     }
 }