예제 #1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("LoadingPoint") && _defaultWorker.FacingRight)
     {
         _collectingCart = null;
     }
 }
예제 #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("LoadingPoint") && _defaultWorker.FacingRight)
        {
            FindTopLevelParent(other.transform);
            _collectingCart = _topLevelParent.transform.Find("CollectBoxHolder/CollectBox").gameObject.GetComponent <CollectingCart>();

            if (_collectingCart._amountInCart == 0)
            {
                AmountElevatorCollect = AmountElevatorCollect;
            }
            else if (_collectingCart._amountInCart >= _defaultWorker.Capacity)
            {
                AmountElevatorCollect         += _defaultWorker.Capacity;
                _collectingCart._amountInCart -= _defaultWorker.Capacity;
            }
            else if (_collectingCart._amountInCart < _defaultWorker.Capacity)
            {
                AmountElevatorCollect        += _collectingCart._amountInCart;
                _collectingCart._amountInCart = 0;
            }
        }
    }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     _collectingCart = null;
 }