Esempio n. 1
0
    //deposit all luggages being held
    protected override void Interact()
    {
        if (toggle)
        {
            //get player's destination
            PlayerNode destination = luggageOwner.GetComponentInChildren <PlayerNode>();

            //check if player will be issued a ticket for losing luggage
            Player receiver = Player.Instance;
            if (!receiver.GetItemFrom(this, 1, content, out List <ItemTransferrable> items, luggageOwner))
            {
                destination.gameObject.AddComponent <LostLuggageTicket>();
                destination.SetTicket();
            }

            Player.Instance.GetComponent <PlayerController>().TransportPlayer(destination.GetPositionInTileMap());

            //restart toggle and customer
            toggle       = false;
            luggageOwner = null;
        }
        else
        {
            Player giver = Player.Instance;
            giver.DropItemTo(this, content);
        }
    }