private void RotateArm(Vector3 target_dir, bool warp, float dt)
 {
     if (!rotation_complete)
     {
         float num = MathUtil.AngleSigned(Vector3.up, target_dir, Vector3.forward);
         float val = num - arm_rot;
         val = MathUtil.Wrap(-180f, 180f, val);
         rotation_complete = Mathf.Approximately(val, 0f);
         float num2 = val;
         if (warp)
         {
             rotation_complete = true;
         }
         else
         {
             num2 = Mathf.Clamp(num2, (0f - turn_rate) * dt, turn_rate * dt);
         }
         arm_rot += num2;
         arm_rot  = MathUtil.Wrap(-180f, 180f, arm_rot);
         arm_go.transform.rotation = Quaternion.Euler(0f, 0f, arm_rot);
         if (!rotation_complete)
         {
             StartRotateSound();
             looping_sounds.SetParameter(rotateSound, HASH_ROTATION, arm_rot);
         }
         else
         {
             StopRotateSound();
         }
     }
 }
Beispiel #2
0
 public void SetPercentComplete(float progress)
 {
     loopingSounds.SetParameter(miningSoundEvent, HASH_PERCENTCOMPLETE, progress);
 }