void Update() { //print("micro name : "+microphone); if (microphone.loudness > seuilHatarake && !ongoingHatarakading && !enumLock && yellingO_Meter == 8 && !hatarakeLocked) { StartCoroutine(GrowingAreaOfEffect()); } if (onCoolDown) { coolDownTickTime = coolDownTickTime + Time.deltaTime; if (coolDownTickTime > coolDownTickThreshold) { coolDownTickTime = 0; yellingO_Meter++; } if (yellingO_Meter >= 8) { onCoolDown = false; } } if (Input.GetMouseButton(0) && !charge && !moveLocked) { pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); //pos.y = transform.position.y; pos.y = 2; //navComponent.SetDestination (pos); //colliders = Physics.OverlapSphere(pos, 1f /* Radius */); //print("un deux un deux"); Collider[] colliders = Physics.OverlapSphere(pos, 1f /* Radius */); if (!(colliders.Length > 0 && colliders[0].tag == "Employe") && pos != null && pos != transform.position) { if (tNav.OnGraph(pos, 0)) { //tMemory.SetItem("sabotage", false); setTarget(pos); } } } if (tMemory.GetItem <bool>("enDeplacement") && !moveSoundLock) { int rdmIndex = Random.Range(0, bossMovingSounds.Length); bossMovingSounds[rdmIndex].Play(); moveSoundLock = true; } else if (!tMemory.GetItem <bool>("enDeplacement") && moveSoundLock) { moveSoundLock = false; } }
//[RAINSerializableField] //private GameObject boxDeTravail; //[RAINSerializableField] //private GameObject chill; //[RAINSerializableField] //private Transform _target; // [RAINSerializableField] //private float motivation = 100;// variable conditionnant le départ en pause. motivation = 0 -> go to Pause; public override void Think() { RAIN.Memory.BasicMemory tMemory = AI.WorkingMemory as RAIN.Memory.BasicMemory; GameObject targ = tMemory.GetItem("myTarget") as GameObject; //Debug.Log ("boxxboxxboxxboxx: "+ boxx.name); //print ("dd"); // create target //GameObject target = (GameObject)Instantiate(Resources.Load("prefab/target2")); //target.transform.position = new Vector3(22, 1, 6); //_target = targ.transform.GetChild (0); // Debug.Log ("_target: "+ _target.name); if (targ != null) { //targ.gameObject.GetComponentInChildren<NavigationTargetRig>().Target.MountPoint = target.transform; //targ.gameObject.GetComponentInChildren<NavigationTargetRig>().Target.TargetName = "NavTarget"; //AI.Motor.MoveTo (targ.transform.GetChild (0).position); // AI.Motor.MoveTo (targ.gameObject.GetComponentInChildren<NavigationTargetRig>().Target.Position); AI.Motor.MoveTo(targ.transform.position); } }
// accesseur pour savoir si le musicien est en train de danser public bool IsTheMusicianDancing() { AIRig aiRig = sceneLeader.GetComponentInChildren <AIRig>(); RAIN.Memory.BasicMemory tMusicianMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory; return(tMusicianMemory.GetItem <bool>("isDancing")); }
// 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); } }
// 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); } } }
// Use this for initialization void Start() { isAlreadyInRange = false; suicideMemory = tMemory.GetItem <bool>("suicidaire"); moveMemory = tMemory.GetItem <bool>("enDeplacement"); workingMemory = tMemory.GetItem <bool>("auTravail"); employeProfile = GameObject.Find("EmployeeProfile").GetComponent <employeeID>(); data.InitializeEmployee(); this.transform.GetChild(0).GetComponent <SpriteRenderer>().color = this.GetComponent <Employe>().data.hairColor; this.transform.GetChild(1).GetComponent <SpriteRenderer>().color = this.GetComponent <Employe>().data.topColor; }
// [RAINSerializableField] //private float motivation = 100;// variable conditionnant le départ en pause. motivation = 0 -> go to Pause; public override void Think() { charge = (bool)tMemory.GetItem("charge"); //Vector3 pos; if (!charge) { if (Input.GetMouseButton(0)) { // timer += Time.deltaTime; // actionArea.localScale = new Vector3(timer,actionArea.localScale.y,timer); // } // else // { pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); //pos.y = transform.position.y; pos.y = 2; //navComponent.SetDestination (pos); colliders = Physics.OverlapSphere(pos, 1f /* Radius */); Debug.Log("pospospospospospospospospos: " + pos); Debug.Log("COLLIDERRRSRSRSRSRRS: " + colliders.Length); if (colliders != null && colliders.Length > 0) { Debug.Log("COLLIDER: " + colliders[0].name); Debug.Log("COLLIDER colliders[0].tag: " + colliders[0].tag); } } if (pos != null && pos != AI.Body.transform.position && (colliders == null || (colliders != null && (colliders.Length == 0 || colliders[0].tag == "Nav")))) { //targ.gameObject.GetComponentInChildren<NavigationTargetRig>().Target.MountPoint = target.transform; //targ.gameObject.GetComponentInChildren<NavigationTargetRig>().Target.TargetName = "NavTarget"; //AI.Motor.MoveTo (targ.transform.GetChild (0).position); // AI.Motor.MoveTo (targ.gameObject.GetComponentInChildren<NavigationTargetRig>().Target.Position); AI.Motor.MoveTo(pos); } if (pos == AI.Body.transform.position) { Debug.Log("RESET DE POSITIONNNN: " + pos); // pos = null; } //print ("mouseDown: "+ pos); } //Debug.Log ("boxxboxxboxxboxx: "+ boxx.name); //print ("dd"); // create target //GameObject target = (GameObject)Instantiate(Resources.Load("prefab/target2")); //target.transform.position = new Vector3(22, 1, 6); //_target = targ.transform.GetChild (0); // Debug.Log ("_target: "+ _target.name); }