Esempio n. 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (numElements < lines * columns && collision.IsTouchingLayers(dropLayer))
        {
            CharacterController character        = collision.GetComponent <CharacterController>();
            Vector3             newResetPosition = topLeftCornerPosition + new Vector3((numElements % columns) * elementSize.x, (numElements / columns) * (-elementSize.y));
            character.PendingDrop(zone, newResetPosition);
            character.ApplyResetPosition();
            elements[numElements] = character;
            ++numElements;

            if (this.zone == Zone.Purgatory)
            {
                this.OnAddPurgatoty.Invoke(collision.gameObject);
            }
        }
    }