-
Notifications
You must be signed in to change notification settings - Fork 0
/
Properties.cs
63 lines (49 loc) · 1.09 KB
/
Properties.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Properties : MonoBehaviour {
// class for keeping all the often used properties
private readonly float gravity = -0.0031f;
private readonly float windmin = -0.001f;
private readonly float windmax = 0.001f;
private readonly float airresistance = 0.00005f;
private float windforce;
// says which cannon to fire
private bool firegoat;
void Start() {
windforce = 0;
// change wind directio nevery 0.5s
InvokeRepeating("ChangeWind", 1.0f, 0.5f);
firegoat = false;
}
public float GetGravity() {
return gravity;
}
public float GetWindforce() {
return windforce;
}
public float GetWindMax() {
return windmax;
}
public bool IsGoatCannon() {
return firegoat;
}
public float GetAirRes() {
return airresistance;
}
public void ChangeCannon() {
if (firegoat) {
firegoat = false;
} else {
firegoat = true;
}
}
void ChangeWind() {
windforce = Random.Range (windmin, windmax);
}
void Update() {
if (Input.GetKeyDown(KeyCode.Tab)) {
ChangeCannon();
}
}
}