コード例 #1
0
ファイル: DeskFan.cs プロジェクト: mahilab/SyntactsBracelet
 void UpdateAxes()
 {
     if (!lockYaw)
     {
         yawAngle = 30 * Mathf.Sin(Mathf.PI * 2 * yawFreq * yawTime);
         yawTime += Time.deltaTime;
     }
     bladeSpeed = BraceletUtility.Remap(speedKnob.KnobPercent(), 0, 1, minSpeed, maxSpeed);
     pitchAngle = BraceletUtility.Remap(pitchKnob.KnobPercent(), 0, 1, minAngle, maxAngle);
     pitchAxis.localEulerAngles  = new Vector3(-pitchAngle, 0, 0);
     yawAxis.localEulerAngles    = new Vector3(0, yawAngle, 0);
     bladeAxis.localEulerAngles += new Vector3(0, 0, bladeSpeed * speedGain) * Time.deltaTime;
 }
コード例 #2
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.layer == 13)
     {
         trail.enabled = true;
     }
     else
     {
         audioSource.PlayRandom(bounceSounds);
     }
     if (held)
     {
         var v = bracelet.GetVelocityEstimate().magnitude;
         var a = BraceletUtility.Remap(v, 0, 0.75f, 0.1f, 1);
         bracelet.tactors.VibrateAll(new Sine(175) * new ASR(0.0f, 0.1f, 0.15f, a));
     }
 }