예제 #1
0
파일: Anim.cs 프로젝트: scriptorum/LD40
        // Known Issue: This is a non-frame-skipping implementation.
        // If the FPS is high enough, it will max out displaying 1 frame
        // per update call, and higher FPS will not change that.
        public void Update()
        {
            if (paused)
            {
                return;
            }

#if UNITY_EDITOR
            if (!Application.isPlaying && !livePreview)
            {
                return;
            }
#endif

            if (sequence == null)
            {
                return;
            }

            elapsed += Time.deltaTime;
            if (elapsed >= sequence.deltaTime)
            {
                elapsed -= sequence.deltaTime;
                if (++frame >= sequence.frameArray.Count)
                {
                    frame = 0;
                    onLoop.Invoke(this);
                }
                UpdateView();
            }
        }
예제 #2
0
 public void OnDragEnabled(bool enabled, PointerEventData eventData)
 {
     onSelection.Invoke(enabled, unitData);
 }