void Start() { timerText = GameObject.FindWithTag("hudTT").GetComponent <Text>(); killCounter = GameObject.FindWithTag("hudKC").GetComponent <Text>(); scoreText = GameObject.FindWithTag("hudSC").GetComponent <Text>(); sbKill = GameObject.FindWithTag("sbKC").GetComponent <Text>(); sbShots = GameObject.FindWithTag("sbBC").GetComponent <Text>(); sbTime = GameObject.FindWithTag("sbTT").GetComponent <Text>(); sbScore = GameObject.FindWithTag("sbSC").GetComponent <Text>(); sbShotPercentage = GameObject.FindWithTag("sbBP").GetComponent <Text>(); sbHighScore = GameObject.FindWithTag("sbHS").GetComponent <Text>(); pControl = GameObject.FindWithTag("pControl").GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController>(); cControl = GameObject.FindWithTag("Player").GetComponent <CameraToggleController>(); wSwitch = GameObject.FindWithTag("wHolder").GetComponent <CS_WeaponSwitch>(); wSwitch2 = GameObject.FindWithTag("wHolder2").GetComponent <CS_WeaponSwitch>(); wCamera = GameObject.FindWithTag("wCamera"); hudUI = GameObject.FindWithTag("HUD"); newHS = GameObject.FindWithTag("newHS"); pRank = GameObject.FindWithTag("sbRank").GetComponent <Text>(); dManager = GameObject.FindWithTag("dManager").GetComponent <CS_DataManager>(); StartMission(); // timerLimit = timerLimit* Time.deltaTime; }
public CS_GameData(CS_DataManager dManager) { highScore = dManager.pHighScore; totalBulletsFired = dManager.bFired; totalBulletsHit = dManager.bHit; globalKills = dManager.totalKills; }
public static void SaveGame(CS_DataManager dManager) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/UnitySoldiers.sav"; FileStream stream = new FileStream(path, FileMode.Create); CS_GameData data = new CS_GameData(dManager); formatter.Serialize(stream, data); stream.Close(); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Start() { dManager = GameObject.FindWithTag("dManager").GetComponent <CS_DataManager>(); dManager.panelActive = false; }