Пример #1
0
    IEnumerator IE_LAY()
    {
        _IE_Grabling = true;

        RigidbodyConstraints RC = _Body.constraints;

        _Body.constraints = RigidbodyConstraints.FreezeAll;

        yield return(new WaitForSeconds(0.1f));

        S_PositMove MP = new S_PositMove(transform, _TAGET_CONV_POSIT, _TAGET_CONV_NAP);

        while (MP._IS_Final())
        {
            MP.MOVES();

            if (MP._Is_Break())
            {
                _IE_Grabling      = false;
                _Body.constraints = RC;
                yield break;
            }

            yield return(new WaitForSeconds(0.01f));
        }

        _Is_Freeze = true;

        yield return(new WaitForSeconds(0.1f));

        MP.Final();


        _Animator.SetInteger("ActionMode", 1);
        _Animator.SetTrigger("ActionReplaceObject");


        yield return(new WaitForSeconds(0.1f));


        _Animator.SetInteger("ActionMode", 0);
        _Animator.SetInteger("MoveMode", 0);


        yield return(new WaitForSeconds(1f));

        _TAGET_CONV.AddChest(_TAGET_Chest);

        Clear();

        _Body.constraints = RC;

        _Is_Grab     = false;
        _Is_Freeze   = false;
        _IE_Grabling = false;
    }
Пример #2
0
    IEnumerator IE_GRABLING()
    {
        _IE_Grabling = true;

        RigidbodyConstraints RC = _Body.constraints;

        _Body.constraints = RigidbodyConstraints.FreezeAll;


        yield return(new WaitForSeconds(0.1f));

        S_PositMove MP = new S_PositMove(transform, _TAGET_POSIT, _TAGET_NAP);

        while (MP._IS_Final())
        {
            MP.MOVES();

            if (MP._Is_Break())
            {
                _IE_Grabling      = false;
                _Body.constraints = RC;
                yield break;
            }

            yield return(new WaitForSeconds(0.01f));
        }

        _Is_Freeze = true;
        yield return(new WaitForSeconds(0.1f));



        MP.Final();


        if (_TAGET_Chest.Is_Container())
        {
            _Animator.SetTrigger("ActionPickObject");
        }
        else
        {
            _Animator.SetTrigger("ActionPickFloorObject");
        }


        while (!_Is_Capture)
        {
            yield return(new WaitForSeconds(0.1f));
        }

        _TAGET_Chest.Event_Capture();

        _Animator.SetInteger("MoveMode", 1);

        yield return(new WaitForSeconds(0.5f));


        _Body.constraints = RC;

        _Is_Grab     = true;
        _Is_Freeze   = false;
        _IE_Grabling = false;
    }