示例#1
0
    public void FindDragTarget()
    {
        if (burden != null)
        {
            burden.Drop();
            burden.RecycleAction -= OnBurdenRecycled;
            burden = null;
        }
        else
        {
            if (_interactive[0] != null)
            {
                var treeTrunk = _interactive[0].GetComponentInParent <TreeTrunk>();
                burden = treeTrunk;
                burden.RecycleAction += OnBurdenRecycled;
                burden.Carry(Joint);
            }
        }

        Drag = burden != null;
    }
    private void EndCoProgram()
    {
        Speaker.Speak();

        Animator.SetBool(_walkStateName, false);
        Animator.SetBool(_cutStateName, false);
        Animator.SetBool(_dragStateName, false);
        _inProgress = false;
        _target     = null;

        if (_trunk != null)
        {
            if (!_trunk.IsRecycling)
            {
                _trunk.Drop();
            }

            _trunk = null;
        }
        Joint.connectedBody = null;

        if (_nextProgram.HasValue)
        {
            _currentProgramType = _nextProgram;
            if (_nextTarget != null)
            {
                _target     = _nextTarget;
                _nextTarget = null;
            }
        }
        else
        {
            SelectNextProgram();
        }

        _nextProgram = null;
    }