Advertisement
zhardyCode

Education Game - Game Manager

Mar 29th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.15 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using UnityEngine.UI;
  6.  
  7. public class GameManager : MonoBehaviour {
  8.  
  9.     //begining stats for the player that can be inherited from other classes
  10.     public static float esteem = 0;
  11.     public static float satisfaction = 0;
  12.     public static float risk = 0;
  13.     public static bool std = false;
  14.     public static float gameOverTimer = 300f;
  15.     public static float RandTimer = 5f;
  16.     public static float money = 25f;
  17.     public static float timeFactor;
  18.     public static bool isPaused = false;
  19.    
  20.     //Checks to prompt a question if the conditions of time and location are met.
  21.     public static bool activateBarQuestion;
  22.     public static bool activateClinicQuestion;
  23.     public static bool activateResturantQuestion;
  24.     public static bool activateClubQuestion;
  25.  
  26.     public static bool activateFountainQuestion;
  27.     public static bool activateParkQuestion;
  28.     public static bool activateSecurityQuestion;
  29.     public static bool activateLibraryQuestion;
  30.  
  31.     public static bool activateMenQuestion;
  32.     public static bool activateWomenQuestion;
  33.     public static bool activateFratSoroityQuestion;
  34.     public static bool activateApartmentsQuestion;
  35.  
  36.     public static bool activateBookStoreQuestion;
  37.     public static bool activateCafeteriaQuestion;
  38.     public static bool activateCampusServicesQuestion;
  39.     public static bool activateCoffeeShopQuestion;
  40.  
  41.     void Start()
  42.     {
  43.         timeFactor = 1;
  44.         Time.timeScale = timeFactor;
  45.  
  46.     }
  47.  
  48.     //makes sure esteem, risk, and satisfaction do not go beyond 100 or below 0
  49.     void Update()
  50.     {
  51.         if(esteem >= 100)
  52.         {
  53.             esteem = 100;
  54.         }
  55.  
  56.         if (risk >= 100)
  57.         {
  58.             risk = 100;
  59.         }
  60.  
  61.         if (satisfaction >= 100)
  62.         {
  63.             satisfaction = 100;
  64.         }
  65.  
  66.         if (esteem <= 0)
  67.         {
  68.             esteem = 0;
  69.         }
  70.  
  71.         if (risk <= 0)
  72.         {
  73.             risk = 0;
  74.         }
  75.  
  76.         if (satisfaction <= 0)
  77.         {
  78.             satisfaction = 0;
  79.         }
  80.     }
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement