public static string PickRandomResponse() { float playerNotoriety = PlayerNotoriety.GetPlayerNotoriety(); string temp; if (playerNotoriety >= 5f) { int randomIndex = Random.Range(0, responsesGood.Count); temp = responsesGood[randomIndex]; return(temp); } else if (playerNotoriety <= -5f) { int randomIndex = Random.Range(0, responsesBad.Count); temp = responsesBad[randomIndex]; return(temp); } else if (playerNotoriety > -5f && playerNotoriety < 5f) { int randomIndex = Random.Range(0, responsesNeutral.Count); temp = responsesNeutral[randomIndex]; return(temp); } else { temp = "*DEBUG ME!!*"; return(temp); } }
private void Update() { localNoteriety = PlayerNotoriety.GetPlayerNotoriety(); if (localNoteriety <= noterietyValueToTrigger && isBodyParts == false) { foreach (GameObject body_part in bodyParts) { if (body_part.activeInHierarchy == false) { body_part.SetActive(true); } } isBodyParts = true; } if (localNoteriety > noterietyValueToTrigger && isBodyParts == true) { foreach (GameObject body_part in bodyParts) { if (body_part.activeInHierarchy == true) { body_part.SetActive(false); } } isBodyParts = false; } }
// Update is called once per frame void Update() { float n = PlayerNotoriety.GetPlayerNotoriety(); //Mathf.Lerp(PlayerNotoriety.GetPlayerNotoriety(), 0f, frequencyOfNotorietyIncrease); if (n != 0f && Time.timeScale != 0f) //timer > frequencyOfNotorietyIncrease && Time.timeScale != 0f) { timer -= Time.deltaTime; if (n < 0f && timer <= 0f) { PlayerNotoriety.IncreasePlayerNotoriety(); timer = frequencyOfNotorietyIncrease; //Debug.Log("Notoriety is going up." + n.ToString()); } else if (n > 0f && timer <= 0f) { PlayerNotoriety.DecreasePlayerNotoriety(); timer = frequencyOfNotorietyIncrease; //Debug.Log("Notoriety is going down." + n.ToString()); } else { //Debug.Log("Notoriety is 0"); } } //else //{ //} //Debug.Log("Notoriety:\t" + n.ToString()); }
private void Update() { _blackScreen.color = (_blackScreen.color.a > 0 && _fps.enabled)? new Color(0, 0, 0, (_blackScreen.color.a - (Time.deltaTime / 3.0f))) : _blackScreen.color; if (PlayerNotoriety.GetPlayerNotoriety() <= -5f && _fps.enabled) { _fps.enabled = false; StopAllCoroutines(); StartCoroutine(Wake_Up()); } }
private void Start() { localNoteriety = PlayerNotoriety.GetPlayerNotoriety(); foreach (GameObject body_part in bodyParts) { if (body_part.activeInHierarchy == true) { body_part.SetActive(false); } } isBodyParts = false; }
/// <summary> /// Called at the end of the execution order. /// </summary> private void Update() { // On the first update, generate each cell if (_firstUpdate) { Generate(); _firstUpdate = false; } // If the difference between the cell distance and player position is large enough, translate and regenerate the cell if (!_hasStartedTranslation) { if (playerPosition != Vector3.zero) { _hasCompletedTranslation = false; StartCoroutine(Translate()); _cellUpdates++; _hasStartedTranslation = true; if (_cellUpdates == 9) { _player.parent.position -= playerPosition * 100.0f; _cellUpdates = 0; } } } else { if (_cellUpdates == 0) { _hasStartedTranslation = false; } } if (PlayerNotoriety.GetPlayerNotoriety() <= -3.0f) { exitDoor.SetActive(true); } else { exitDoor.SetActive(false); } }
// Update is called once per frame private void Update() { _footprintMaterial.color = Color.Lerp(_footprintMaterial.color, new Color(1f - Mathf.Clamp(PlayerNotoriety.GetPlayerNotoriety() / ((1.001f - _noterietyImpact) * 5f), 0, 1f), Mathf.Clamp(1.0f - Mathf.Abs(PlayerNotoriety.GetPlayerNotoriety() / ((1.001f - _noterietyImpact) * 5f)), 0, 1f), 1f - Mathf.Clamp(PlayerNotoriety.GetPlayerNotoriety() / ((1.001f - _noterietyImpact) * -5f), 0, 1f)), Time.deltaTime); }
public static string PickRandomPassive() { float playerNotoriety = PlayerNotoriety.GetPlayerNotoriety(); string temp = "*REALLY BUGGED*"; if (playerNotoriety >= good) //good { int randomIndex; if (DistanceToTarget.distanceToTarget <= near) //near { randomIndex = Random.Range(0, goodNearPassive.Count); temp = goodNearPassive[randomIndex]; //Debug.Log("A Good Near thing was said"); return(temp); } else if (DistanceToTarget.distanceToTarget <= mid) //mid { randomIndex = Random.Range(0, goodMidPassive.Count); temp = goodMidPassive[randomIndex]; //Debug.Log("A Good Mid thing was said"); return(temp); } else if (DistanceToTarget.distanceToTarget > mid) //far { randomIndex = Random.Range(0, goodFarPassive.Count); temp = goodFarPassive[randomIndex]; //Debug.Log("A Good Far thing was said"); return(temp); } else { //Debug.Log("Why is this happening?"); temp = "*DEBUG ME!!*"; return(temp); } } else if (playerNotoriety <= bad) //bad { int randomIndex; if (DistanceToTarget.distanceToTarget <= near) //near { randomIndex = Random.Range(0, badNearPassive.Count); temp = badNearPassive[randomIndex]; //Debug.Log("A Bad Near thing was said"); return(temp); } else if (DistanceToTarget.distanceToTarget <= mid) //mid { randomIndex = Random.Range(0, badMidPassive.Count); temp = badMidPassive[randomIndex]; //Debug.Log("A Bad Mid thing was said"); return(temp); } else if (DistanceToTarget.distanceToTarget > mid) //far { randomIndex = Random.Range(0, badFarPassive.Count); temp = badFarPassive[randomIndex]; //Debug.Log("A Bad Far thing was said"); return(temp); } else { //Debug.Log("Why is this happening?"); temp = "*DEBUG ME!!*"; return(temp); } } else if (playerNotoriety > bad && playerNotoriety < good) //neutral { int randomIndex; if (DistanceToTarget.distanceToTarget <= near) //near { randomIndex = Random.Range(0, goodNearPassive.Count); temp = goodNearPassive[randomIndex]; //Debug.Log("A Neutral Near thing was said"); return(temp); } else if (DistanceToTarget.distanceToTarget <= mid) //mid { randomIndex = Random.Range(0, goodMidPassive.Count); temp = goodMidPassive[randomIndex]; //Debug.Log("A Neutral Mid thing was said"); return(temp); } else if (DistanceToTarget.distanceToTarget > mid) //far { randomIndex = Random.Range(0, goodFarPassive.Count); temp = goodFarPassive[randomIndex]; //Debug.Log("A Neutral Far thing was said"); return(temp); } else { //Debug.Log("Why is this happening?"); temp = "*DEBUG ME!!*"; return(temp); } } else { temp = "*DEBUG ME!!*"; return(temp); } }