Пример #1
0
 // Actions sur le chariot
 private void ActionFoodSlot(FoodSlotController foodSlot)
 {
     if (IsPressedAction(1) == true)
     {
         TakeFood(foodSlot);
     }
 }
Пример #2
0
    private void TakeFood(FoodSlotController foodSlot)
    {
        if (_vegetableCarried == null)
        {
            VegetableConfig vegetableConfig = foodSlot.Take();

            if (vegetableConfig != null)
            {
                _vegetableCarried = vegetableConfig;

                _playerCanvas.EnableFeedback("Food/food_" + vegetableConfig.name.ToLower(), true);
            }
        }
    }
Пример #3
0
    private void OnTriggerStay(Collider other)
    {
        if (other.tag == "Children" && other.transform.parent.parent.gameObject.tag == "SpawnerPlayer" + _joystickNumber.ToString())
        {
            _childInRange = other.GetComponentInParent <Child>();
            _childInRange.GetComponentInChildren <Renderer>().material = _body.material;

            ActionChild();
        }
        else if (other.tag == "FoodSlot")
        {
            FoodSlotController foodSlot = other.GetComponent <FoodSlotController>();
            ActionFoodSlot(foodSlot);
        }
    }