private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { EffectBox box = other.GetComponent <EffectBox>(); if (box == null) { box = other.gameObject.AddComponent <EffectBox>(); } box.AddEffect(gameObject.GetComponent <TextMeshPro>().text); Destroy(gameObject); } }
public override void Update(GameTime t, Dictionary <String, Actor> .ValueCollection targets) { UpdateFrame(t); currentItem = Actor.CurrentItem; Vector3 update = new Vector3(20 * Actor.Facing, 0); switch (frame) { case 0: break; case 1: if (currentItem != null) { //EffectBox = new BoundingBox(currentItem.EffectBox.Min + update + Actor.Location, currentItem.EffectBox.Max + update + Actor.Location); foreach (Actor y in targets) { if ((EffectBox.Intersects(y.Bounds) && !Actor.Equals(y))) //Collision Detection. Ideally reduces movement to outside collision bounds. { y.ApplyAction(this, Actor); } } } break; case 2: AvailableLow.NoButton = "Standing"; AvailableLow.LStickAction = "Walking"; break; case 3: break; default: break; } }
public void Effect_Box_Update(int e_select) { if (e_select == 0) { effect_vol = 0f; EffectBox.GetComponent <Image>().sprite = SoundBox[0]; } else if (e_select == 1) { effect_vol = 0.2f; EffectBox.GetComponent <Image>().sprite = SoundBox[1]; } else if (e_select == 2) { effect_vol = 0.4f; EffectBox.GetComponent <Image>().sprite = SoundBox[2]; } else if (e_select == 3) { effect_vol = 0.6f; EffectBox.GetComponent <Image>().sprite = SoundBox[3]; } else if (e_select == 4) { effect_vol = 0.8f; EffectBox.GetComponent <Image>().sprite = SoundBox[4]; } else if (e_select == 5) { effect_vol = 1f; EffectBox.GetComponent <Image>().sprite = SoundBox[5]; } SaveSettings(); GameObject.Find("Menu_Blop").GetComponent <AudioSource>().volume = effect_vol; GameObject.Find("Chest_Sound").GetComponent <AudioSource>().volume = effect_vol; }