示例#1
0
    private void CheckCarryEnd(GameObject grabObject)
    {
        bool flag = true;

        for (int i = 0; i < all.Count; i++)
        {
            flag &= !all[i].grabbedObjects.Contains(grabObject);
        }
        if (!flag)
        {
            return;
        }
        grabObject.GetComponentInParent <IGrabbable>()?.OnRelease();
        if (grabObject != null && grabStartPositions.ContainsKey(grabObject))
        {
            float magnitude = (grabStartPositions[grabObject] - grabObject.transform.position).To2D().magnitude;
            if (magnitude > 0.1f)
            {
                StatsAndAchievements.AddCarry(human, magnitude);
            }
        }
        grabStartPositions.Remove(grabObject);
        if (!CheatCodes.throwCheat)
        {
            Human componentInParent = grabObject.GetComponentInParent <Human>();
            if (componentInParent != null)
            {
                componentInParent.grabbedByHuman = null;
            }
        }
    }