// Update is called once per frame void Update() { if (tMemory.GetItem <bool>("destinationReached") && !tMemory.GetItem <bool>("inLifeScene")) // gestion du timer d'attente sur les NT { if (waitTimer < endWaitTimer && !tMemory.GetItem <bool>("waitTimerHasEnded")) { waitTimer = waitTimer + Time.deltaTime; } else if (!tMemory.GetItem <bool>("waitTimerHasEnded")) { tMemory.SetItem <bool>("waitTimerHasEnded", true); } if (waitTimer != 0 && tMemory.GetItem <bool>("waitTimerHasEnded")) { waitTimer = 0; endWaitTimer = (int)Random.Range(minEndWaitTimer, maxEndWaitTimer); } } if (tMemory.GetItem <bool>("guideIsOnPov"))// gestion du timer d'attente sur les points de vue { if (povTimer < endPovTimer && !tMemory.GetItem <bool>("povTimerHasEnded")) { povTimer = povTimer + Time.deltaTime; } else if (povTimer != 0) { povTimer = 0; } if (povTimer > endPovTimer) { tMemory.SetItem <bool>("povTimerHasEnded", true); tMemory.SetItem <bool>("guideIsOnPov", false); } } }
void Update() { if (tMemory.GetItem <bool>("destinationReached"))// gestion du timer d'attente au point de vue et des variables RAIN correspondantes { timer = timer + Time.deltaTime; } else if (timer != 0) { timer = 0; } if (timer > endTimer) { tMemory.SetItem <bool>("timerIsOver", true); } }
public void Engueule() { //Chaque seconde : motivation -= feignantise DONC si feignantise est grand, les pauses seront plus fréquentes. //if (data.fatigue < data.fatigueMAX) { //suicidaire = true; tMemory.SetItem <bool>("hatarake", true); //tMemory.SetItem<bool>("auTravail", true); // tMemory.SetItem<bool>("wander", false); // this.setActiveSound(true, false, false, false, false, false, false, false, false); //} }
// Update is called once per frame public void Update() { if (soundTimer < endSoundTimer && !tMemory.GetItem <bool>("soundTimerHasEnded")) // gestion des timers et des variables RAIN correspondantes { soundTimer = soundTimer + Time.deltaTime; } else if (!tMemory.GetItem <bool>("soundTimerHasEnded")) { tMemory.SetItem <bool>("soundTimerHasEnded", true); } if (soundTimer != 0 && tMemory.GetItem <bool>("soundTimerHasEnded")) { soundTimer = 0; endSoundTimer = (int)Random.Range(minEndSoundTimer, maxEndSoundTimer); } //---------------------- if (tMemory.GetItem <bool>("destinationReached")) { if (waitTimer < endWaitTimer && !tMemory.GetItem <bool>("waitTimerHasEnded")) { waitTimer = waitTimer + Time.deltaTime; } else if (!tMemory.GetItem <bool>("waitTimerHasEnded")) { tMemory.SetItem <bool>("waitTimerHasEnded", true); } if (waitTimer != 0 && tMemory.GetItem <bool>("waitTimerHasEnded")) { waitTimer = 0; endWaitTimer = (int)Random.Range(minEndWaitTimer, maxEndWaitTimer); } } //--------------------------------- if (tMemory.GetItem <bool>("isDancing")) { if (danceTimer < endDanceTimer) { danceTimer = danceTimer + Time.deltaTime; } else { danceTimer = 0; tMemory.SetItem <bool>("isDancing", false); } } }
public override void Init(GameObject agent) { base.Init(agent); memory=new RAIN.Memory.BasicMemory(); memory.AIInit(rainAI); memory.SetItem<AIController>("controller",this); environment = GetEnvironment(); mind = new BasicMind(); mind.AIInit(rainAI); mind.AI.Body = agent; Debug.Log("SettingUP BasicMind: " + tree.name); mind.SetBehavior(tree, null); rainAI.WorkingMemory = memory; }
void Update() { if (data.fatigue >= data.fatigueMAX && !suicideLock) { suicideLock = true; tMemory.SetItem <bool>("suicidaire", true); GameManager.instance.GetComponent <GameManager>().victoryLocked = true; employeProfile.setJProfile(0, this.gameObject); GameManager.instance.cameraController.FollowEmployee(this.gameObject, 1000, 0f); Rigidbody rb = GetComponent <Rigidbody>(); rb.isKinematic = true; rb.detectCollisions = false; tSens.DisableSensor("Visual Sensor"); //tSens.GetSensor("Visual Sensor").IsActive = false; } Vector3 distance = boss.transform.position - this.transform.position; if (distance.magnitude < 15 && !isAlreadyInRange) // si il vient d'entrer dans le champ de vision du boss { emitActivitySign(); isAlreadyInRange = true; suicideMemory = tMemory.GetItem <bool>("suicidaire"); moveMemory = tMemory.GetItem <bool>("enDeplacement"); workingMemory = tMemory.GetItem <bool>("auTravail"); } else if (distance.magnitude >= 15 && isAlreadyInRange) // si il en sort { isAlreadyInRange = false; } else if ((suicideMemory != tMemory.GetItem <bool>("suicidaire") || moveMemory != tMemory.GetItem <bool>("enDeplacement") || workingMemory != tMemory.GetItem <bool>("auTravail"))) { // si il change d'état if (isAlreadyInRange) { emitActivitySign(); } GameObject target = tMemory.GetItem <GameObject>("myTarget"); suicideMemory = tMemory.GetItem <bool>("suicidaire"); moveMemory = tMemory.GetItem <bool>("enDeplacement"); workingMemory = tMemory.GetItem <bool>("auTravail"); //print("ratio : "+(float)(data.fatigue) / (float)(data.fatigueMAX)); if (((float)(data.fatigue) / (float)(data.fatigueMAX)) > seuilDepression) { //play photocopier; if (!depressif) { depressif = true; print(this.name + " viens de rentrer en dépression"); this.setActiveSound(false, false, false, false, true, false, false, false, false); } } else if (workingMemory && !moveMemory && target.CompareTag("WorkHelp")) { depressif = false; //print("photocopier"); //play photocopier; this.setActiveSound(false, false, false, true, false, false, false, false, false); } else if (workingMemory && !moveMemory && target.CompareTag("Box")) { depressif = false; //play clavier PC //print("clavier"); this.setActiveSound(false, false, true, false, false, false, false, false, false); } else if (!workingMemory && !moveMemory && target.CompareTag("Box")) { depressif = false; //play facebook //print("facebook"); this.setActiveSound(false, false, false, false, false, true, false, false, false); } else if (!workingMemory && !moveMemory && (target.name.Equals("CoffeeTrigger") || target.name.Equals("CoffeeTrigger 1"))) { depressif = false; //play coffee //print("coffee"); this.setActiveSound(false, false, false, false, false, false, true, false, false); } else if (!workingMemory && !moveMemory && target.name.Equals("DrinkTrigger")) { depressif = false; //play vending machine //print("vending machine"); this.setActiveSound(false, false, false, false, false, false, false, true, false); } else if (!workingMemory && !moveMemory && (target.name.Equals("TVTrigger") || target.name.Equals("TVTrigger 1"))) { depressif = false; //play gaming //print("gaming"); this.setActiveSound(false, false, false, false, false, false, false, false, true); } else { depressif = false; //print("nothing"); this.setActiveSound(false, false, false, false, false, false, false, false, false); } } }
public void setTarget(Vector3 target) { tMemory.SetItem("enDeplacement", true); tMemory.SetItem("target", target); GameManager.instance.employeeProfile.nullifyAllProfile(); }