示例#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;
 }