This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Detail_Populator : MonoBehaviour | |
{ | |
//These two variables control how far the objects could potentially be placed. | |
//Ex. If these two variables were set to 20, the the farthest an object could be placed is at (20,0,20) | |
public float EndRangeX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Crate_Populator : MonoBehaviour | |
{ | |
//This list holds the crate prefabs we can spawn. | |
public List<GameObject> CrateSpawnables = new List<GameObject>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Zombie_Populator : MonoBehaviour { | |
//This determines how many packs of zombies will be spawned IE; how many clusters around the map, not how many zombie gameobjects | |
public int PackNumber; | |
//This determines how many zombie gameobjects are in each pack of zombies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Populator_Manager : MonoBehaviour | |
{ | |
//IMPORTANT: Dynamic means objects that can be interacted with (Zombies, Crates, etc.) Static means objects that can't be interacted with like grass or trees | |
//Here we have the four populators we created. We create a reference to each one so we can easily access them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class Sleep_Clickable : ClickableParent | |
{ | |
//DaycountManager is the manager that handles specifically the days system | |
public DayCountManager DayManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class DayCountManager : MonoBehaviour | |
{ | |
//This is the current day. We set it at 1 at the start | |
[HideInInspector] | |
public int CurrentDay; | |
//We make a Populator_Manager reference so we can drag the Populator_Manager and use its difficulty function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Enemy_Zombie : Entity_Parent { | |
//We create reference to the AudioSource that we can drag in because the zombies are a prefab | |
public AudioSource Source; | |
//This is the Audioclip of the zombie dying. Audio clips are made by downloading sounds from the internet and dragging them into the asset window | |
public AudioClip DieClip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[System.Serializable] | |
public class FoodScript : ClickableParent { | |
public AudioSource Source; | |
public AudioClip Clip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
//Because UI is a seperate package from Unity as a whole, we have to import using the using command. | |
using UnityEngine.UI; | |
public class UIManager : MonoBehaviour { | |
//We create Text objects in our script. The text we created earlier will be dragged into this script through the editor. | |
public Text HealthText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Arduino provides a set of prebuilt code to run servos. To bring it into our code, we use this command. | |
#include <Servo.h> | |
//A class is a collection of differnet data and functions you can use to make coding more conveinent. In this case, we | |
//make a class that holds every servo on our robot so we can easily control it | |
class ServoManager{ | |
public: | |
//Every servo on the robot is created in our class | |
Servo FrontRightThigh; | |
Servo FrontRightKnee; |