// Use this for initialization void Start() { launchManager = GameObject.FindGameObjectWithTag("LaunchManager").GetComponent <LaunchManager>(); log = launchManager.LoggingManager; rpl = launchManager.FirstPersonController.transform.Find("PositionLogger").GetComponent <ReplayRoute>(); if (rpl.isActivated()) { var parameterValue = 0; int.TryParse(launchManager.LoggingManager.GetParameterValue(launchManager.ReplaySessionId, "mapType"), out parameterValue); mapType = parameterValue; } else { var parameterValue = 0; int.TryParse(launchManager.LoggingManager.GetParameterValue("mapType"), out parameterValue); mapType = parameterValue; } whiteBG = new Texture2D(1, 1, TextureFormat.ARGB32, false); whiteBG.SetPixel(0, 0, Color.white); whiteBG.Apply(); SetupMap(SceneManager.GetActiveScene().name); posX = Screen.width - mapWidth; posY = 0;//Screen.width - mapWidth; mainCam = launchManager.FirstPersonController.GetComponentInChildren <Camera>(); arrow = launchManager.FirstPersonController.transform.Find("GuidanceArrow").transform; }
// Update is called once per frame void Update() { rpl = launchManager.FirstPersonController.transform.Find("PositionLogger").GetComponent <ReplayRoute>(); if (rpl.isActivated()) { deltaTime = maxDuration - rpl.getTimeSpent(); } else { deltaTime = deltaTime - Time.deltaTime; } if (deltaTime >= 0) { int displayMin = ((int)deltaTime) / 60; string min = displayMin.ToString(); if (displayMin < 10) { min = "0" + min; } int displaySec = (int)(deltaTime - displayMin * 60); string sec = displaySec.ToString(); if (displaySec < 10) { sec = "0" + sec; } time[0].text = min + " :"; time[1].text = sec; } }
// Update is called once per frame void Update() { if (decays) { ReplayRoute rpl = launchManager.FirstPersonController.transform.Find("PositionLogger").GetComponent <ReplayRoute>(); if (rpl.isActivated()) { deltaMoney = startMoney - (rpl.getTimeSpent() * rateOfDecay); } else { deltaMoney = deltaMoney - (Time.deltaTime * rateOfDecay); } } if (deltaMoney >= 0) { int displayUnit1 = (int)((deltaMoney) / 100); string franc = displayUnit1.ToString(); if (displayUnit1 < 10) { franc = " " + franc; } int displayUnit2 = (int)(deltaMoney - displayUnit1 * 100); string cent = displayUnit2.ToString(); if (displayUnit2 < 10) { cent = "0" + cent; } money[0].text = franc + " ."; money[1].text = cent; } }
// Use this for initialization void Start() { // Fading Parameters blackTexture = new Texture2D(1, 1, TextureFormat.ARGB32, false); blackTexture.SetPixel(0, 0, Color.black); blackTexture.Apply(); // Apply all SetPixel calls fadingOut = false; alpha = 0; lerpTime = 0; launchManager = GameObject.FindGameObjectWithTag("LaunchManager").GetComponent <LaunchManager>(); rpl = launchManager.FirstPersonController.transform.Find("PositionLogger").GetComponent <ReplayRoute>(); if (rpl.isActivated()) { maxDuration = int.Parse(launchManager.LoggingManager.GetParameterValue(launchManager.ReplaySessionId, "maxDuration")); timePressure = launchManager.LoggingManager.GetParameterValue(launchManager.ReplaySessionId, "timePressure") .ToLower() == "yes"; } else { maxDuration = int.Parse(launchManager.LoggingManager.GetParameterValue("maxDuration")); timePressure = launchManager.LoggingManager.GetParameterValue("timePressure") .ToLower() == "yes"; } time = this.gameObject.GetComponentsInChildren <Text> (); deltaTime = maxDuration; if (!timePressure) { gameObject.SetActive(false); } }
// Use this for initialization void Start() { launchManager = GameObject.FindGameObjectWithTag("LaunchManager").GetComponent <LaunchManager>(); rpl = launchManager.FirstPersonController.transform.Find("PositionLogger").GetComponent <ReplayRoute>(); if (rpl.isActivated()) { rateOfDecay = int.Parse(launchManager.LoggingManager.GetParameterValue(launchManager.ReplaySessionId, "rateOfDecay")); startMoney = int.Parse(launchManager.LoggingManager.GetParameterValue(launchManager.ReplaySessionId, "startMoney")); } else { rateOfDecay = int.Parse(launchManager.LoggingManager.GetParameterValue("rateOfDecay")); startMoney = int.Parse(launchManager.LoggingManager.GetParameterValue("startMoney")); } money = this.gameObject.GetComponentsInChildren <Text> (); deltaMoney = startMoney; decays = true; // Fading Parameters blackTexture = new Texture2D(1, 1, TextureFormat.ARGB32, false); blackTexture.SetPixel(0, 0, Color.black); blackTexture.Apply(); // Apply all SetPixel calls fadingOut = false; alpha = 0; lerpTime = 0; int expCondition = int.Parse(launchManager.LoggingManager.GetParameterValue("expCondition")); if (expCondition == 1) { decays = true; } else { decays = false; } }