Exemplo n.º 1
0
 private void MakeSingleton()
 {
     if (!instance)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
        public void HideMessage()
        {
            //decrease the size of the window to conceal the message
            PropertyAnimator animator = new PropertyAnimator(this, AnimeProperty.SIZE_HEIGHT, Height, MinimumSize.Height, 2);

            animator.AnimatorListener = this;
            animator.Start();
            this.isMHidden = true;
            //Height = MinimumSize.Height;
        }
Exemplo n.º 3
0
        public void ShowMessage()
        {
            //increase the size of the window to reveal the message
            PropertyAnimator animator = new PropertyAnimator(this, AnimeProperty.SIZE_HEIGHT, Height, MaximumSize.Height, 1);

            animator.AnimatorListener = this;
            animator.Start();
            this.isMHidden = false;
            // Height = MaximumSize.Height;
        }
Exemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        //refInt = new Ref<int>(() => i, z => { i = z; });
        //refInt.Value = 10;
        //print(i);

        t0 = new Test0();
        print(nameof(t0.V2));
        //PropertyAnimator.GetInstance().StartAnimatingPropertyVector2(t0, nameof(t0.V2), new Vector2(0.4f,0.4f), new Vector2(2.4f,2.4f), 10.0f);
        PropertyAnimator.GetInstance().StartAnimatingPropertyInt(t0, nameof(t0.I), 0, 5, 10.0f);
    }
Exemplo n.º 5
0
    private static IEnumerator _Animate(float initial, float target, float duration, EasingFunction easing, PropertyAnimator propertyAnimator, Callback callback)
    {
        float current  = initial;
        float progress = 0.0f;

        while (progress < 1.0f)
        {
            progress = Mathf.Min(1.0f, progress + Time.unscaledDeltaTime / duration);
            current  = easing.Interpolate(initial, target, progress);
            propertyAnimator(current);
            yield return(null);
        }

        if (callback != null)
        {
            callback();
        }
    }
Exemplo n.º 6
0
 public static Coroutine Animate(float initial, float target, float duration, EasingFunction easing, PropertyAnimator propertyAnimator, Callback callback = null)
 {
     return(Coroutine.Start(_Animate(initial, target, duration, easing, propertyAnimator, callback)));
 }