コード例 #1
0
 // Use this for initialization
 void Start()
 {
     System.Type t = output.obj.GetType();
     if (incremental)
     {
         List <GameObject> children = new List <GameObject>();
         for (int i = 0; i < transform.childCount; i++)
         {
             children.Add(transform.GetChild(i).gameObject);
         }
         children.OrderBy(x => x.transform.localPosition.sqrMagnitude);
         for (int i = 0; i < children.Count; i++)
         {
             output.obj = children[i].GetComponent(t);
             output.SetValue(incrementAmount * i);
         }
     }
     else
     {
         for (int i = 0; i < transform.childCount; i++)
         {
             output.obj = transform.GetChild(i).GetComponent(t);
             output.SetValue(transform.GetChild(i).localPosition.sqrMagnitude);
         }
     }
 }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (everyFrame)
     {
         field.SetValue(Mathf.Lerp(min, max, Random.value));
     }
 }
コード例 #3
0
 // Update is called once per frame
 void Update()
 {
     if (!mouseDown || (mouseDown && Input.GetMouseButton(0)))
     {
         pos = Vector3.Lerp(Input.mousePosition, pos, smoothing);
         if (xAxis)
         {
             output.SetValue(Mathf.Lerp(min, max, pos.x / Screen.width));
         }
         else
         {
             output.SetValue(Mathf.Lerp(min, max, pos.y / Screen.height));
         }
     }
 }
コード例 #4
0
 // Update is called once per frame
 void Update()
 {
     for (int i = 0; i < group.all.Count; i++)
     {
         output.obj = group.all[i].GetComponent(type);
         output.SetValue(Utils.Lerp(minValue, maxValue, ccAudioController.FFT[(int)Mathf.Lerp(minFFT, maxFFT, (float)i / group.all.Count)]));
     }
 }
コード例 #5
0
 void Update()
 {
     //if (round) {
     if (v != t)
     {
         v = Mathf.Lerp(v, t, .2f);
         obj.SetValue(v);
     }
     //}
 }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        Vector3 p0 = screenCamera.WorldToScreenPoint(minPosition.position);
        Vector3 p1 = screenCamera.WorldToScreenPoint(maxPosition.position);

        if (down)
        {
            Vector2 p = Input.mousePosition.xy();

            Vector2 a2p = new Vector2(p.x - p0.x, p.y - p0.y);
            Vector2 a2b = new Vector2(p1.x - p0.x, p1.y - p0.y);

            t = Vector2.Dot(a2p, a2b) / Vector2.SqrMagnitude(a2b);
        }
        v = Mathf.Lerp(v, t, smoothing);
        transform.position = screenCamera.ScreenToWorldPoint(Vector3.Lerp(p0, p1, v));
        output.SetValue(Mathf.Lerp(minMax.x, minMax.y, v));
    }
コード例 #7
0
 // Update is called once per frame
 void Update()
 {
     if ((animTime < time && fwd) || (animTime > 0 && !fwd))
     {
         if (fwd)
         {
             animTime += Time.deltaTime;
         }
         else
         {
             animTime -= Time.deltaTime;
         }
         field.SetValue(Mathf.Lerp(min, max, animation.Evaluate(animTime / time)));
     }
     else if (!fired)
     {
         fired = true;
         Messenger.Broadcast(firePostAnimation);
     }
 }
コード例 #8
0
 void Increase()
 {
     reflectFloat.SetValue((float)reflectFloat.GetFloat() + 1);
 }
コード例 #9
0
 public override void Update()
 {
     base.Update();
     field.SetValue(Mathf.Lerp(minValue, maxValue, value));
 }
コード例 #10
0
 void Update()
 {
     output.SetValue(Utils.Lerp(min, max, curve.Evaluate(t)));
 }
コード例 #11
0
 // Update is called once per frame
 void Update()
 {
     v += speed * Time.deltaTime;
     output.SetValue(v);
 }
コード例 #12
0
 // Update is called once per frame
 void Update()
 {
     field.SetValue(Mathf.Lerp(min, max, Random.value));
 }
コード例 #13
0
 protected override void OnEvent()
 {
     outValue.SetValue(val);
 }
コード例 #14
0
 // Update is called once per frame
 void Update()
 {
     output.SetValue(((float)input.GetValue()) * multiplier);
 }
コード例 #15
0
 // Update is called once per frame
 void Update()
 {
     field.SetValue(min + (max - min) * ccAudioController.FFT [fft]);
 }