/// <summary> /// Creates default highlighting animation. /// </summary> public void UseDefaultHighlightAni() { // Create highlight animation highlightAni = new Anime(); highlightAni.AnimateFloat(a => highlightSprite.Alpha = a) .AddTime(0f, () => highlightSprite.Alpha) .AddTime(0.25f, 1f) .Build(); // Highlight sprite sizing animation. ISection <float> highlightSection = null; if (IsHighlightSpriteVertical) { highlightSection = highlightAni.AnimateFloat(size => highlightSprite.Height = size).AddTime(0f, () => highlightSprite.Height); } else { highlightSection = highlightAni.AnimateFloat(size => highlightSprite.Width = size).AddTime(0f, () => highlightSprite.Width); } highlightSection.AddTime(0.25f, () => HighlightedSize).Build(); // Create unhighlight animation. unhighlightAni = new Anime(); unhighlightAni.AnimateFloat(a => highlightSprite.Alpha = a) .AddTime(0f, () => highlightSprite.Alpha) .AddTime(0.25f, 0f) .Build(); // Highlight sprite sizing animation. ISection <float> unhighlightSection = null; if (IsHighlightSpriteVertical) { unhighlightSection = unhighlightAni.AnimateFloat(size => highlightSprite.Height = size).AddTime(0f, () => highlightSprite.Height); } else { unhighlightSection = unhighlightAni.AnimateFloat(size => highlightSprite.Width = size).AddTime(0f, () => highlightSprite.Width); } unhighlightSection.AddTime(0.25f, 0f).Build(); }