// 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();
        }
        // Update is called once per frame
        void Update()
        {
            float val = _pxRef.GetValue(_ChannelId);
            //int quantLevel = _pcoord._OutValueQuantizeLevel;

            /*
             * float inputRange = 2.0f;
             * float dispRange = _dispMax - _dispMin;
             *
             * float valDisp = dispRange * val / inputRange + _dispMin;
             * valDisp = Mathf.Clamp (valDisp, _dispMin, _dispMax);
             */

            float valDisp = MapValue(val, _inMin, _inMax, _dispMin, _dispMax);

            string format = "F" + _FractionNumCount.ToString();
            string valTxt = valDisp.ToString(format);

            //valDisp.ToString(

            foreach (var tm in _TxtMshs)
            {
                tm.text = valTxt;
                Color cr = tm.color;
                cr.a     = _Alpha;
                tm.color = cr;
            }
        }
        // Update is called once per frame
        void Update()
        {
            bool bOK = CheckPixelRef();

            if (!bOK)
            {
                return;
            }

            float   value = _pixelRef.GetValue(_fetchChannel);
            float   freq  = _FreqMultiplier * value;
            float   scl   = Mathf.Sin(freq * Time.realtimeSinceStartup);
            Vector3 scl3  = scl * Vector3.one;

            transform.localScale = scl3;
        }
示例#4
0
        // Update is called once per frame
        void Update()
        {
            bool bOK = CheckPixelRef();

            if (!bOK)
            {
                return;
            }

            float value   = _pixelRef.GetValue(_fetchChannel);
            float value01 = (value - (-1.0f)) / 2.0f;

            int   textCount = _texts.Count;
            float idStep    = 2.0f / (float)textCount;

            int choseId = Mathf.RoundToInt(value01 / idStep);

            string txt = _texts [choseId];

            _GenText.Invoke(txt);
        }
示例#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;
            }
        }
        // Update is called once per frame
        void Update()
        {
            bool bPRefOK = CheckPixelRef();

            if (!bPRefOK)
            {
                TurnLineRenderer(false);
                return;
            }

            Pixel px     = _pixel.GetPixel();
            int   chlCnt = px.GetChannelCount();
            bool  bON    = (chlCnt > _chl);

            if (!bON)
            {
                TurnLineRenderer(false);
                return;
            }

            TurnLineRenderer(true);


            float val   = _pixel.GetValue(_chl);
            float lerpT = (val + 1.0f) / 2.0f;

            Vector3 endTgt = Vector3.Lerp(_Start, _End, lerpT);

            LineRenderer lr     = GetComponent <LineRenderer> ();
            Vector3      pStart = lr.GetPosition(0);
            Vector3      pEnd   = lr.GetPosition(1);

            pEnd = Vector3.Lerp(pEnd, endTgt, Time.deltaTime * _LerpSpd);

            lr.SetPosition(0, _Start);
            lr.SetPosition(1, pEnd);
        }