public virtual void Register(TakeBuff a) { Notification.NoticeBelow(Languages.getString(codeThongBao)); host = a; for (int i = 0; i < buffs.Count; i++) { a.Register(this, buffs[i].typeBuff, buffs[i].value); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.TryGetComponent(out Portal portal)) { AddPoints(); HitPortal?.Invoke(); PlayerController.FreezeTime(); portal.Explosion(); } if (collision.gameObject.TryGetComponent(out Buff buff)) { buff.ApplyBuff(); TakeBuff?.Invoke(); } if (_isOpacity == false) { if (collision.gameObject.TryGetComponent(out Enemy enemy)) { Die(); var particle = Instantiate(_dieParticle, transform.position, Quaternion.identity).GetComponent <ParticleSystem>(); particle.startColor = _worldPalette.PlayerColor; particle.transform.GetChild(0).GetComponent <ParticleSystem>().startColor = _worldPalette.PlayerColor; gameObject.SetActive(false); } } if (collision.gameObject.TryGetComponent(out MenuPortal menuPortal)) { HitPortal?.Invoke(); PlayerController.FreezeTime(); menuPortal.Explosion(); } }
public static void BuffToTake(TakeBuff take, int type, float value) { take.Register(null, type, value); }