private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { gameObject.GetComponent <SpriteRenderer>().enabled = false; gameObject.GetComponent <Light>().enabled = false; gameObject.GetComponent <BoxCollider>().enabled = false; Effect.EffectNBT enbt = new Effect.EffectNBT { el = effectLevel, et = effectType, color = particleColor, isNull = false }; nbt = new ItemBar.NBT { effectNBT = enbt, canUse = true, nbtt = ItemBar.NBTType.Effect }; ItemBar.AddItem(ItemBar.ReturnCanUsedPosition(), index); ItemBar.nowSelectNbt = nbt; bt.enabled = true; btImage.enabled = true; btText.enabled = true; } }
public void OnButtonClick() { ItemBar.NBT nowNBT = ItemBar.nowSelectNbt; if (nowNBT.nbtt == ItemBar.NBTType.Effect) { Effect.AddEffect(ItemBar.nowSelectNbt.effectNBT.et, ItemBar.nowSelectNbt.effectNBT.el); PlayerParticle.AddEffect(ItemBar.nowSelectNbt.effectNBT.color); ItemBar.nowSelectNbt = new ItemBar.NBT() { canUse = false }; } ItemBar.UseItem(); bt.enabled = false; btImage.enabled = false; btText.enabled = false; }