Exemplo n.º 1
0
        public void KillObject()
        {
            _itemGetEntity = new ItemGetEntity(_entity, this, string.Empty, Vector3.zero, default);

            _spriteRenderer.color = Color.clear;
            _collider.enabled     = false;
            AllStopTailParticle();

            _onDeathItem.OnNext(_itemGetEntity);
            _onDeathItem.OnCompleted();

            if (_tailPaticles.Count > 0)
            {
                OnStopParticle = _tailPaticles[0].OnDisableAsObservable();

                OnStopParticle.Subscribe(_ =>
                {
                    GameObject.Destroy(this.gameObject);
                });
            }
            else
            {
                GameObject.Destroy(this.gameObject);
            }
        }
Exemplo n.º 2
0
        public void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag(TagName.CHARACTER))
            {
                KillObject();

                _itemGetEntity = new ItemGetEntity
                                 (
                    _entity,
                    this,
                    _entity.ItemMode == Data.ItemMode.Score ? "+" + _entity.Score : _entity.ItemMode.ToString(),
                    transform.position,
                    _entity.ItemMode == Data.ItemMode.Score ? Enum.SEScene.ScoreItem : Enum.SEScene.SpecialItem
                                 );

                _onGetItem.OnNext(_itemGetEntity);
            }
        }