Skip to content
Permalink
d093d85fd1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
52 lines (40 sloc) 903 Bytes
using UnityEngine;
using System.Collections;
public class MasterControl : MonoBehaviour
{
private FPS_HERO hero;
private GameObject[] eGen;
public int Win_Cond = 40;
public int Lose_Cond = 0;
private bool neverdone = true;
// Use this for initialization
void Start ()
{
hero = (FPS_HERO)FindObjectOfType(typeof(FPS_HERO));
eGen = GameObject.FindGameObjectsWithTag("Respawn");
}
//*** put swap skybox somewhere here**
// Update is called once per frame
void Update ()
{
#region WinLose
if(hero.Health <= Lose_Cond)
Application.LoadLevel("GameOver");
if(hero.Score >= Win_Cond)
Application.LoadLevel("VictoryScreen");
#endregion
#region speedup
if(neverdone ==true)
{
if(hero.Score >= (0.7f * Win_Cond))
{
foreach(GameObject e in eGen)
{
e.SendMessage("SpeedUp");
}
neverdone = false;
}
}
#endregion
}
}