|
|
@ -17,7 +17,17 @@ namespace Game { |
|
|
|
modifications.Add(this); |
|
|
|
modifications.Add(this); |
|
|
|
VisualElement element = GameUI.AddModification(panel, this); |
|
|
|
VisualElement element = GameUI.AddModification(panel, this); |
|
|
|
|
|
|
|
|
|
|
|
yield return new WaitForSeconds(Properties.activeDuration); |
|
|
|
float doNothingTime = Properties.activeDuration * 0.7f; |
|
|
|
|
|
|
|
float animateTime = Properties.activeDuration * 0.3f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yield return new WaitForSeconds(doNothingTime); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float current = 0; |
|
|
|
|
|
|
|
while (current < animateTime) { |
|
|
|
|
|
|
|
current += Time.deltaTime; |
|
|
|
|
|
|
|
element.style.opacity = new StyleFloat(1 - current / animateTime); |
|
|
|
|
|
|
|
yield return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
element.RemoveFromHierarchy(); |
|
|
|
element.RemoveFromHierarchy(); |
|
|
|
modifications.Remove(this); |
|
|
|
modifications.Remove(this); |
|
|
|