Exemple #1
0
    // TODO: Checking if had collided with player, then take a drink

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player") && _mug == null && _canOrder == true)
        {
            InkeeperInventory inventory = other.GetComponent <InkeeperInventory>();
            if (inventory != null)
            {
                if (inventory.CheckTrey())
                {
                    var trey = inventory.ReturnTrey();
                    if (trey != null)
                    {
                        if (trey.ReturnMugsCount() != 0)
                        {
                            trey.GiveGuest(this);
                        }
                    }
                }
                else
                {
                    if (inventory.ReturnMugCount() != 0)
                    {
                        inventory.GiveGuest(this);
                    }
                }
            }
        }
    }
Exemple #2
0
 private void Initialize()
 {
     _parent = transform.parent;
     foreach (Transform child in transform)
     {
         _mugSlot.Add(child);
     }
     _keeperInventory = PlayerExtension.GetPlayerObject().GetComponent <InkeeperInventory>();
 }
 private void Awake()
 {
     _anim      = GetComponent <Animator>();
     _inventory = GetComponent <InkeeperInventory>();
 }
 private void Awake()
 {
     _inventory = GetComponent <InkeeperInventory>();
 }