Browse Source

When AnimatedSprite2D creates new sprite components, use the AnimatedSprite2D's enabled status. Closes #678.

Lasse Öörni 10 years ago
parent
commit
b55321fc40
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/Urho3D/Urho2D/AnimatedSprite2D.cpp

+ 3 - 0
Source/Urho3D/Urho2D/AnimatedSprite2D.cpp

@@ -327,7 +327,10 @@ void AnimatedSprite2D::SetAnimation(Animation2D* animation, LoopMode2D loopMode)
 
 
             // Create StaticSprite2D component
             // Create StaticSprite2D component
             if (track.hasSprite_)
             if (track.hasSprite_)
+            {
                 staticSprite = trackNode->CreateComponent<StaticSprite2D>();
                 staticSprite = trackNode->CreateComponent<StaticSprite2D>();
+                staticSprite->SetEnabled(IsEnabledEffective());
+            }
         }
         }
 
 
         if (staticSprite)
         if (staticSprite)