// Update is called once per frame
        void Update()
        {
            PixelRef pxRef = CheckPXRef();

            if (!pxRef)
            {
                return;
            }

            if (!CheckPlayableDirector())
            {
                return;
            }

            float value = pxRef.GetValue(0);

            float speed = Utils.MapValue(value, _inMin, _inMax, _SpeedMin, _SpeedMax);
            float delay = Utils.MapValue(value, _inMin, _inMax, _Delay01Min, _Delay01Max);

            double duration = _playableDirector.duration;

            _playableDirector.time = Mathf.Repeat(
                Time.realtimeSinceStartup * speed + (float)duration * delay, (float)duration);
            _playableDirector.Evaluate();
        }
 // Use this for initialization
 void Start()
 {
     if (_pxRef == null)
     {
         _pxRef = GetComponentInParent <PixelRef> ();
     }
 }
 private PixelRef CheckPXRef()
 {
     if (!_pxRef)
     {
         _pxRef = GetComponentInParent <PixelRef> ();
     }
     return(_pxRef);
 }
Exemplo n.º 4
0
        public void Paint()
        {
            PixelRef pxRef = CheckPXRef();

            if (!pxRef)
            {
                return;
            }

            pxRef.SetValue(_slider.value);
        }
Exemplo n.º 5
0
        public void Update()
        {
            PixelRef pxRef = CheckPXRef();

            if (!pxRef)
            {
                return;
            }

            float val = pxRef.GetValue(0);

            float val01 = Mathf.InverseLerp(-1.0f, 1.0f, val);

            if (_mode == Mode.PHASE)
            {
                _emojiCtrl._Delay01 = val01;
            }
            else if (_mode == Mode.SPEED)
            {
                _emojiCtrl._Speed = val01 * _speedFactor;
            }
        }