Beispiel #1
0
        protected override void OnDeath()
        {
            DropSpawner dropSpawner = GetComponent <DropSpawner>();

            if (dropSpawner != null)
            {
                GameObject drop      = dropSpawner.DropObject();
                RexObject  rexObject = drop.GetComponent <RexObject>();
                if (rexObject != null)
                {
                    float yPosition = transform.position.y;
                    if (slots.collider != null)
                    {
                        yPosition = slots.collider.bounds.max.y;
                        if (rexObject.slots.collider)
                        {
                            yPosition = slots.collider.bounds.max.y + rexObject.slots.collider.bounds.size.y * 0.5f;
                        }
                    }

                    rexObject.SetPosition(new Vector2(transform.position.x, yPosition));
                }
            }
        }