예제 #1
0
        private void ApplyAnimationStyle(IndicatorAnimation value)
        {
            var index = (int)value;

            if (null == stylesCache[index])
            {
                var assembly     = typeof(BusyIndicatorAnimation).GetTypeInfo().Assembly;
                var resourceName = "LibraProgramming.Windows.UI.Xaml.BusyIndicatorAnimation." + index + ".xaml";

                using (var reader = new StreamReader(assembly.GetManifestResourceStream(resourceName)))
                {
                    var xaml = reader.ReadToEnd();
                    stylesCache[index] = XamlReader.Load(xaml) as Style;
                }
            }

            animation?.Stop();

            AnimationStyle = stylesCache[index];

            if (null != animation && String.Equals(RunningStateName, CurrentVisualState))
            {
                animation.Start();
            }
        }
예제 #2
0
    void Awake()
    {
        _gameManager = (GameManager)FindObjectOfType(typeof(GameManager));
        _indicators  = transform.FindChild("GameIndicators").GetComponent <IndicatorAnimation>();
        _navAgent    = GetComponent <NavMeshAgent>();
        _gameManager.timeManager.OnNewYear  += CheckAge;
        _gameManager.timeManager.OnNewMonth += DeplishCarrot;

        _sprite = GetComponent <SpriteRenderer>();
    }
예제 #3
0
        /*
         *      private void OnContentPositionChanged(ContentPosition value)
         *      {
         *          SynchronizeContentPosition();
         *      }
         */

        private void OnIndicatorAnimationChanged(IndicatorAnimation value)
        {
            ApplyAnimationStyle(value);
        }