Example #1
0
        void AttachToCharacter(CharacterMovement character)
        {
            if (controlledCharacter != null)
            {
                //enable ai for the last controlled character
                controlledCharacter.GetComponent <AIControl>().enabled = true;
            }

            controlledCharacter = character;

            if (controlledCharacter != null)
            {
                //disable ai for our new controlled character
                controlledCharacter.GetComponent <AIControl>().enabled = false;

                ragdollController = controlledCharacter.GetComponent <RagdollController>();

                RagdollTransform hipBone = ragdollController.ragdoll.RootBone();
                camFollow.target     = hipBone.followTarget.transform;
                camFollow.updateMode = UpdateMode.Update;
            }
        }
        void Awake()
        {
            ragdollController = GetComponent <RagdollController>();

            characterMovement = GetComponent <CharacterMovement>();

            movementController = GetComponent <MovementController>();

            humanoidAim = GetComponent <Game.Combat.HumanoidAim>();



            if (cameraScript != null)
            {
                originalCamScriptTarget = cameraScript.m_Target;
                originalUpdateMode      = cameraScript.updateMode;
            }

            SubscribeToEvents();


            ragdollRightHand = ragdollController.ragdoll.GetBone(HumanBodyBones.RightLowerArm).transform.GetChild(0);
        }
Example #3
0
 void Awake()
 {
     characterMovement = GetComponent <CharacterMovement>();
 }