void Awake() { proximityDetector = transform.GetComponent <ProximityDetector>(); fov = transform.GetComponent <FieldOfView>(); status = transform.GetComponent <Health>(); frustration = transform.GetComponent <FrustrationComponent>(); playerGun = GameObject.Find("GunControls").GetComponent <GunControls>(); previousPosition = transform.position; previousRotation = transform.eulerAngles.z; }
private void OnLevelWasLoaded(int level) { if (level == 0 || level == 1) { recordGameplay = false; } if (level == 2 || level == 3 || level == 4 || level == 5) { player = GameObject.Find("PlayerController"); cursor = GameObject.Find("GunControls"); agent = GameObject.Find("Monster"); levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>(); previousPlayerPosition = player.GetComponent <PlayerController>().transform.position; recordGameplay = true; currentPlaySession = new GamePlaySession(); reportData = new Queue <List <string> >(); FrustrationComponent agentFrustration = agent.GetComponent <FrustrationComponent>(); currentPlaySession.startOfSession = DateTime.Now; currentPlaySession.frustration = agentFrustration.frustrationIsActive; currentPlaySession.frustrationLocked = agentFrustration.lockFrustration; currentPlaySession.frustrationRange = (agentFrustration.minFrustration + "-" + agentFrustration.maxFrustration); currentPlaySession.agentAvgFrustration = new List <float>(); currentPlaySession.agentMoreFrustrated = 0; currentPlaySession.agentLessFrustrated = 0; currentPlaySession.agentBothFrustrated = 0; currentPlaySession.playerMoreFrustrated = 0; currentPlaySession.playerLessFrustrated = 0; currentPlaySession.playerBothFrustrated = 0; currentPlaySession.startByEpoch = (long)(DateTime.UtcNow - epochStart).TotalSeconds; currentPlaySession.levelID = SceneManager.GetActiveScene().name; } if (level == 6 || level == 7 || level == 8) { recordGameplay = false; currentPlaySession.endOfSession = DateTime.Now; } }