Skip to content

Commit aa320c1

Browse files
committed
- More performance info :)
1 parent 6578ef5 commit aa320c1

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

client/UniDroneClient/Assets/code/DroneControlPSMove.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class DroneControlPSMove : MonoBehaviour
1717
private bool isInAir = false, doingAflip = false;
1818
private float timer = 0, timerNoPress = 0;
1919
private float prevTrigger = 0;
20+
public float power = 1; //1f is max
2021

2122

2223
// We save a list of Move controllers statically, so we only have one list
@@ -73,20 +74,20 @@ void Update ()
7374
}
7475
if(timer > 0.2f){
7576
if(move.Acceleration.x > 0.02f){
76-
SendToNode("/left", move.Acceleration.x * move.Acceleration.x );
77+
SendToNode("/left", move.Acceleration.x * move.Acceleration.x * 2.2f * power);
7778
}
7879
else if(move.Acceleration.x < -0.02f){
79-
SendToNode("/right", (move.Acceleration.x * move.Acceleration.x ));
80+
SendToNode("/right", (move.Acceleration.x * move.Acceleration.x * 2.2f *power));
8081
}else{
8182
SendToNode("/left", 0);
8283
SendToNode("/right", 0);
8384
}
8485

8586
if(move.Acceleration.y < -0.02f){
86-
SendToNode("/front", move.Acceleration.y * move.Acceleration.y );
87+
SendToNode("/front", move.Acceleration.y * move.Acceleration.y * 2.2f * power);
8788
}
8889
else if(move.Acceleration.y > 0.02f){
89-
SendToNode("/back", move.Acceleration.y * move.Acceleration.y );
90+
SendToNode("/back", move.Acceleration.y * move.Acceleration.y * 2.2f * power );
9091
}else{
9192
SendToNode("/front", 0);
9293
SendToNode("/back", 0);

client/UniDroneClient/Assets/code/performance/Performance.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ public class Performance : MonoBehaviour {
1010
public List<TimerInfo> timings;
1111
public Text txtStateName;
1212
public Text txtTime;
13+
14+
public Text txtD1;
15+
public Text txtD2;
16+
17+
public DroneControlPSMove d1Controller;
18+
public DroneControlPSMove d2Controller;
19+
1320
public Transform timer;
1421

1522
int currentIndex = 0;
@@ -39,6 +46,10 @@ void UpdateTime()
3946
Debug.Log("state: "+timings[currentIndex].musicState);
4047
pctLeft = timings[currentIndex].Pct(currentTime);
4148
timer.localScale = new Vector3(1f,Mathf.Clamp01(1f-pctLeft),1f);
49+
50+
51+
d1Controller.power = timings[currentIndex].D1Power/100f;
52+
d2Controller.power = timings[currentIndex].D2Power/100f;
4253
}
4354

4455
void UpdateVisuals()
@@ -49,6 +60,9 @@ void UpdateVisuals()
4960

5061
txtTime.text = string.Format("{0:00} : {1:00} ", min, sec);
5162

63+
txtD1.text = timings[currentIndex].drone1;
64+
txtD2.text = timings[currentIndex].drone2;
65+
5266
}
5367
// Update is called once per frame
5468
void Update () {
1.87 KB
Binary file not shown.

0 commit comments

Comments
 (0)