commit next

This commit is contained in:
Kotrba Filip
2020-02-01 20:58:47 +01:00
parent f48dbc9992
commit d62ce6a45d
14 changed files with 330 additions and 11 deletions

View File

@@ -10,6 +10,9 @@ public class BarricadeManager : MonoBehaviour
public OffMeshLink offMeshLink;
public Transform walkPoint;
public AudioSource audioSource = new AudioSource();
public AudioClip buildSound;
// Start is called before the first frame update
void Start()
{
@@ -37,6 +40,7 @@ public class BarricadeManager : MonoBehaviour
public void addPlank()
{
if (health < (barricadePlanks.Count * 50)) {
audioSource.PlayOneShot(buildSound);
health += 50;
offMeshLink.enabled = false;
}

View File

@@ -14,6 +14,9 @@ public class BlockManager : MonoBehaviour
private bool action = false;
public List<GameObject> amountModels = new List<GameObject>();
public AudioSource audioSource = new AudioSource();
public AudioClip doorSound;
// Start is called before the first frame update
void Start()
{
@@ -97,6 +100,7 @@ public class BlockManager : MonoBehaviour
{
if (!animation.isPlaying)
{
audioSource.PlayOneShot(doorSound);
if (!action)
{
animation["Door"].speed = 1;

View File

@@ -11,6 +11,8 @@ public class DayManager : MonoBehaviour
public AudioClip dayClip;
public AudioClip nigtClip;
public int daySurvived = 0;
// Start is called before the first frame update
void Start()
{
@@ -31,6 +33,7 @@ public class DayManager : MonoBehaviour
{
mainSource.PlayOneShot(dayClip);
night = false;
daySurvived++;
}
this.gameObject.transform.Rotate(new Vector3(sunSpeed * Time.deltaTime, 0, 0));

View File

@@ -1,6 +1,5 @@
fileFormatVersion: 2
guid: 7b4c3ee9caf3c064988179097d1d6d91
MonoImporter:
guid: 41e45d644c0cd4b4a8133c39c3ebcfa8
externalObjects: {}
serializedVersion: 2
defaultReferences: []

View File

@@ -7,9 +7,10 @@ public class SpawnManager : MonoBehaviour
public List<GameObject> enemyList = new List<GameObject>();
public List<Transform> spawnPoints = new List<Transform>();
public int enemyNumber = 10;
public int enemyStartNumber = 5;
public GameObject Sun = new GameObject();
bool night = false;
bool alreadySpawn = false;
@@ -22,6 +23,7 @@ public class SpawnManager : MonoBehaviour
// Update is called once per frame
void Update()
{
int enemyNumber = enemyStartNumber + (Sun.GetComponent<DayManager>().daySurvived * enemyStartNumber);
float sunRotationX = Sun.transform.localEulerAngles.x;
sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX;

View File

@@ -16,6 +16,9 @@ public class WeaponManager : MonoBehaviour
public PlayerManager player;
public bool hit = false;
public AudioSource audioSource = new AudioSource();
public AudioClip shootSound;
// Start is called before the first frame update
void Start()
{
@@ -36,6 +39,7 @@ public class WeaponManager : MonoBehaviour
if (particleShoot != null && player.ammo > 1)
{
GameObject shoot = Instantiate(particleShoot, spawnShoot.transform.position, spawnShoot.transform.rotation);
audioSource.PlayOneShot(shootSound);
player.ammo -= 2;
Destroy(shoot, 0.3f);
fireTime = fireRate + Time.time;