コード例 #1
0
 public void Rewind(float duration = 3f, System.Func <float, float, float, float, float> _easing = null, System.Action callback = null)
 {
     state            = PainterState.Animating;
     onRewindComplete = callback;
     for (int i = 0; i < painters.Count; i++)
     {
         painters [i].duration = duration;
         painters [i].Rewind(0f, _easing);
     }
 }
コード例 #2
0
 public void Play(float duration = 3f, System.Func <float, float, float, float, float> _easing = null, System.Action callback = null)
 {
     state      = PainterState.Animating;
     onComplete = callback;
     for (int i = 0; i < instanciate.painters.Count; i++)
     {
         instanciate.painters[i].duration = duration;
         instanciate.painters[i].Play(0f, _easing);
     }
 }
コード例 #3
0
ファイル: SVGPainter.cs プロジェクト: ytsmwhc/SVGPainterUnity
 public void Stop(bool showAll = false)
 {
     state            = PainterState.Complete;
     onComplete       = null;
     onRewindComplete = null;
     for (int i = 0; i < painters.Count; i++)
     {
         painters[i].Stop(showAll);
     }
 }
コード例 #4
0
        // Update is called once per frame
        void Update()
        {
            if (instanciate != null)
            {
                if (state == PainterState.Complete)
                {
                    return;
                }

                if (instanciate.painters.Count >= 1)
                {
                    int checkCompleteCount = 0;
                    for (int i = 0; i < instanciate.painters.Count; i++)
                    {
                        instanciate.painters[i].UpdateLine();
                        PainterAnimationState pstate = instanciate.painters[i].GetState();
                        if (pstate == PainterAnimationState.Complete)
                        {
                            checkCompleteCount++;
                        }
                    }
                    if (checkCompleteCount >= instanciate.painters.Count)
                    {
                        state = PainterState.Complete;

                        if (onRewindComplete != null)
                        {
                            onRewindComplete();
                            onRewindComplete = null;
                        }

                        if (onComplete != null)
                        {
                            onComplete();
                            onComplete = null;
                        }
                    }
                }
            }
        }
コード例 #5
0
			public Painter(NuGenSketchCanvas sketchCanvas)
			{
				_sketchCanvas = sketchCanvas;
				_state = this.GetFreeHandState();
			}
コード例 #6
0
 public Painter(NuGenSketchCanvas sketchCanvas)
 {
     _sketchCanvas = sketchCanvas;
     _state        = this.GetFreeHandState();
 }