private void Start() { pukingEvent = transform.Find("Puke").gameObject; pukingEvent.SetActive(false); movement = GetComponent <CrowdMovement>(); rb = GetComponent <Rigidbody2D>(); }
new void Start() { base.Start(); catEvent = transform.Find("Cat").gameObject; movement = GetComponent <CrowdMovement>(); movement.enabled = false; //DIALOG Dialog = Dialogbox.Dialogsystem.gameObject; Dialogbox.Dialogstate Dend = new Dialogbox.Dialogstate { end = true, callback = talkedToFriend }; Dialogbox.Dialogstate ds0 = new Dialogbox.Dialogstate { Avatar = Portrait, Title = "Miss Mr. Mew", Message = "Miss Mr. Mew is sitting on the Couch, observing the Crowd.", optionA = "*Pet Miss Mr. Mew*", optionB = "", oA_changeval = -10f, oB_changeval = 20f, end = false, callback = talkedToFriend }; Dialogbox.Dialogtransition dt0 = new Dialogbox.Dialogtransition { origial = ds0, oA_followup = Dend, oB_followup = Dend }; ds = new Dialogbox.Dialogstate[2]; ds[0] = ds0; ds[1] = Dend; dt = new Dialogbox.Dialogtransition[1]; dt[0] = dt0; resets = false; }
CrowdMovement GetNextPerson() { // Debug.Log(nextPoolIdx + " <? " + peoplePool.Count); CrowdMovement newP = peoplePool[nextPoolIdx].GetComponent <CrowdMovement>(); nextPoolIdx += 1; return(newP); }
void AddRandom() { CrowdMovement newP = GetNextPerson(); newP.transform.position = this.transform.position; newP.transform.rotation = this.transform.rotation; newP.ForceWalkTo(defaultTarget.position); arravingPeople.Add(newP.gameObject); }
new void Start() { base.Start(); movement = GetComponent <CrowdMovement>(); movement.enabled = false; //DIALOG Dialog = Dialogbox.Dialogsystem.gameObject; NextBehavior(); }
void AddWave(int count, Transform target) { for (int i = 0; i < count; ++i) { CrowdMovement newP = GetNextPerson(); newP.transform.position = this.transform.position; newP.transform.rotation = this.transform.rotation; newP.ForceWalkTo(target.position); newP.dontLeaveTheRoom = true; arravingPeople.Add(newP.gameObject); } }
void Update() { int randomNumber = random.Next(0, 100); CrowdMovement crowd = new CrowdMovement(); if (pos <= 30 && randomNumber > 95) { transform.Translate(new Vector3(0, 0.1f, 0)); pos++; } }
// Update is called once per frame private void Update() { CrowdMovement crowd = new CrowdMovement(); if (!canBeHit) { invulnerable -= Time.captureFramerate; if (invulnerable <= 0) { canBeHit = true; invulnerable = 3; crowd.playerHit(); } } }
private bool ConsiderTalking(Collider2D other) { CrowdMovement otherCrowd = other.gameObject.GetComponent <CrowdMovement>(); if (otherCrowd != null && otherCrowd != this && freeToTalk() && otherCrowd.freeToTalk()) { if (Random.Range(0f, 1f) < talkAfinity) { float duration = Random.Range(10f, 60f * (talkAfinity + otherCrowd.talkAfinity) / 2f); talkUntil = myTime + duration; talkPartner = otherCrowd.transform; currentState = State.TALKING; ChangeState(); // to update the targetPosition for talk&walk otherCrowd.GetSpokenTo(duration, this.transform); audioSource.clip = blaBlaClips[Random.Range(0, blaBlaClips.Length)]; audioSource.Play(); return(true); } } return(false); }
void Start() { crowdmovement = this; start = crowdmovement.transform.position; }