Esempio n. 1
0
    public void switchToAnimation()
    {
        if (!isRagdollMode)
        {
            return;
        }


        switchMode(false);


        act.rb.MovePosition(rbs[0].position - act.tfBody.localPosition);

        act.rb.MoveRotation(Quaternion.LookRotation(act.rb.rotation * Vector3.forward, Vector3.up));


        tfBase.SetParent(act.tfBody, true);

        RagdollCliper.clipPose(tfBase, msClipPose.clip);

        act.playMotion(msClipPose);

        act.rb.isKinematic      = false;
        act.rb.detectCollisions = true;
        act.tfBody.GetComponent <Animation>().enabled = true;
    }
Esempio n. 2
0
        public void deepInit(Animation anim)
        {
            ms = RagdollCliper.createState(anim);

            ms.blendMode = AnimationBlendMode.Blend;

            ms.speed = 1.0f;
        }
Esempio n. 3
0
    void browing()
    {
        move.lerp(0.0f, 5.0f);

        if (migration.isLimitOver && isGround())
        {
            state.changeTo(walk);              //stay );

            RagdollCliper.clipPose(tfHip, ragdoll.ms.clip);

            motion.play(ragdoll.ms);
        }


        output.loudness = 2.0f;
    }
Esempio n. 4
0
    void damaging()
    {
        move.lerp(0.0f, 2.0f);


        if (migration.isLimitOver)
        {
            state.changeTo(walk);              //stay );

            RagdollCliper.clipPose(tfCrotch, ragdoll.ms.clip);

            motion.play(ragdoll.ms);
        }


        output.loudness = 2.0f;
    }
Esempio n. 5
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="act"></param>
    public void deepInit(SkinnedMeshRender smr)
    {
        act = smr.GetComponentInParent <_Action3>();


        tfBase = smr.bones[0];

        rbs = tfBase.GetComponentsInChildren <Rigidbody>();

        colliders = tfBase.GetComponentsInChildren <Collider>();


        msClipPose = RagdollCliper.createState(act.tfBody.GetComponent <Animation>());


        setMaxMoveForDepenetration(rbs);

        switchMode(false);
    }
Esempio n. 6
0
/*
 *      void switchObservedCenter()
 *      {Debug.Log( this.tfObservedCenter.name );
 *
 *              var pre = act.tfObservedCenter;
 *
 *              act.tfObservedCenter = this.tfObservedCenter;
 *
 *              this.tfObservedCenter = pre;
 *
 *      }
 */


    public void setup(PlayerAction3 action)
    {
        act = action;


        smr = act.GetComponentInChildren <SkinnedMeshRender>();

        setupRigidbodys(smr.bones);

        tfRagdollBase.parent = null;

        tfRagdollBase.gameObject.SetActive(false);


        tfRagdollBase.name = "base";                                                            //

        msRagdoll           = RagdollCliper.createState(act.tfBody.GetComponent <Animation>()); //
        msRagdoll.blendMode = AnimationBlendMode.Blend;
        msRagdoll.speed     = 0.0f;
    }
Esempio n. 7
0
    public void switchToAnimation()
    {
        if (isRagdollMode)
        {
            act.tfObservedCenter = tfBodyHeadCenter;

            var tfWapon = act.playerShoot.weapons.current.tf;

            tfWapon.parent = tfBodyHand;

            tfWapon.localPosition = Vector3.zero;

            tfWapon.localRotation = Quaternion.identity;



            tfRagdollBase.gameObject.SetActive(false);

            tfBodyBase.gameObject.SetActive(true);

            act.activateCollider(true);

            act.rb.isKinematic = false;

            smr.switchBones(tfBodyParts);


            act.rb.MovePosition(tfRagdollBase.position - act.tfBody.localPosition);

            act.rb.MoveRotation(Quaternion.LookRotation(act.rb.rotation * Vector3.forward, Vector3.up));


            RagdollCliper.clipPose(tfRagdollBase, msRagdoll.clip);

            act.playMotion(msRagdoll);

            /*
             * for( var i = 1; i < tfBodyParts.Length; i++ )
             * {
             *
             *      var tfBodyPart = tfBodyParts[i];
             *
             *      var tfRagdollPart = tfRagdollParts[i];
             *
             *      tfBodyPart.localPosition = tfRagdollPart.localPosition;
             *
             *      tfBodyPart.localRotation = tfRagdollPart.localRotation;
             *
             * }
             *
             * tfBodyBase.position = tfRagdollBase.position;
             *
             * tfBodyBase.rotation = tfRagdollBase.rotation;
             *
             *
             * //act.playMotion( ragMotion.getNowPosing() );
             *
             * //switchObservedCenter();
             */
        }
    }
Esempio n. 8
0
        public void deepInit(Animation anim)
        {
            ms = RagdollCliper.createState(anim);

            //ms.speed = 0.0f;
        }