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; | |
[RequireComponent(typeof(AudioSource))] | |
public class Weapon_Parent : MonoBehaviour { | |
public AudioSource Source; | |
//Player weapon uses the Weapon_Template Scriptable object to get data for the weapon |
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 Player_Cursor : MonoBehaviour { | |
public Camera main_Camera; | |
public GameObject Player; | |
// Update is called once per frame | |
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; | |
[CreateAssetMenu(fileName = "Weapon_Template", menuName = "Weapons/Template", order = 1)] | |
public class Weapon_Template : ScriptableObject { | |
public float Damage; | |
public float RateOfFire; |
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 Weapon_Pickup : ClickableParent { | |
public Weapon_Template thisWeaponData; | |
public float MinimumDistance; | |
public override void OnClick(Vector3 ClickPosition) | |
{ |
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
public void CheckStatsForDebuffs() // | |
{ | |
Sluggishness(); | |
ShortSightedness(); | |
} | |
//Debuffs and Buffs | |
private void Sluggishness() //Every modifier was a function in the Player_Manager Script | |
{ | |
if (current_Hunger_Level < 90) //Inside every function they had their threshold check, in this case checking if |
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; | |
//Notice how this class doesnn't inherit from Monobehaviour. This means we can't add this to gameobjects | |
public abstract class Modifier_Template | |
{ | |
//By making all of these abstract, we force every modifier to have these functions | |
public abstract float Attribute { get; set; } //This is a property. We're essentially force every child to have a float number variabled named Attribute | |
//This attribute property usage depends on the modifier, but generally, it tells the modifier by how much to change a stat in Player_Manager |
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 Modifier_Manager : MonoBehaviour | |
{ | |
public Player_Manager Player; //Every modifier needs a Player_Mangager, so we create one here instead of getting it for each modifier | |
public List<Modifier_Template> Debuffs = new List<Modifier_Template>(); //We create a list of modifiers |
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 string Name; | |
public float food_Value; | |
public float MMinimumDistance; |
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 WaterScript : ClickableParent { | |
public string Name; | |
public float water_Value; | |
public float MinimumDistance; | |
private Player_Manager Master_Manager; |
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 : ClickableParent | |
{ | |
public List<GameObject> ItemsInside = new List<GameObject>(); //A list is a collection of objects that can be accessed through a numbered list. In this case it holds our prefabs (Picture 1) | |
public int NumberOfItemsToSpawn; //This decides how many times we loop in OnClick(); IE it decides how many objects to spawn | |
public float MinimumDistance; | |
public AudioClip Clip; |
OlderNewer