Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        aim.Disable();
        ik.Disable();
        look.Disable();

        ik.solver.OnPostUpdate += OnPostFBBIK;
    }
        void Start()
        {
            animator = GetComponent <Animator>();

            // Disable the IK components to update them manually in a specific order
            ik.Disable();
            if (aim != null)
            {
                aim.Disable();
            }
        }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     if (null != m_AimIK)
     {
         m_AimIK.Disable();
     }
     if (null != m_FBBIK)
     {
         m_FBBIK.Disable();
     }
 }
Esempio n. 4
0
        void Start()
        {
            // Remember some default local positions
            gunTargetDefaultLocalPosition = gunTarget.localPosition;
            gunTargetDefaultLocalRotation = gunTarget.localRotation;
            camDefaultLocalPosition       = cam.transform.localPosition;

            // Disable the camera and IK components so we can handle their execution order
            cam.enabled = false;
            gunAim.Disable();
            ik.Disable();
        }
Esempio n. 5
0
        void IPeMsg.OnMsg(EMsg msg, params object[] args)
        {
            switch (msg)
            {
            case EMsg.View_Prefab_Build:
                BiologyViewRoot viewRoot = args[1] as BiologyViewRoot;
                m_AnimEffectCtrl = viewRoot.ikAnimEffectCtrl;
                m_IKAimCtrl      = viewRoot.ikAimCtrl;
                m_IKFlashLight   = viewRoot.ikFlashLight;
                m_FBBIK          = viewRoot.fbbik;
                m_GroundFBBIK    = viewRoot.grounderFBBIK;
                m_IKArray        = viewRoot.ikArray;

                if (null != m_IKAimCtrl)
                {
                    m_IKAimCtrl.SetSmoothMoveState(m_SmoothAim);
                }
                m_AutoCloseFBBIK = (null == m_GroundFBBIK);
                if (null != m_FBBIK)
                {
                    m_FBBIK.Disable();
                    m_FBBIK.solver.iterations = 1;
                    m_DefaultMappingValue     = m_FBBIK.solver.leftArmMapping.weight;
                }
                if (null != m_GroundFBBIK)
                {
                    m_DefaultSpineBend = m_GroundFBBIK.spineBend;
                }

                ikEnable                  = m_IKEnable;
                flashLightActive          = m_FlashLightActive;
                enableArmMap              = m_SpineMask.Count == 0;
                enableGrounderSpineEffect = m_SpineMask.Count == 0;
                break;
//			case EMsg.Battle_EnterShootMode:
//				enableGrounderSpineEffect = false;
//				enableArmMap = false;
//				break;
//			case EMsg.Battle_ExitShootMode:
//				enableGrounderSpineEffect = true;
//				enableArmMap = true;
//				break;
//			case EMsg.Battle_PauseShootMode:
//				if(null != m_IKAimCtrl)
//					m_IKAimCtrl.SetActive(false);
//				break;
//			case EMsg.Battle_ContinueShootMode:
//				if(null != m_IKAimCtrl)
//					m_IKAimCtrl.SetActive(true);
//				break;
            }
        }
Esempio n. 6
0
        protected override void Start()
        {
            base.Start();

            // Find the IK components
            aim = GetComponent <AimIK>();
            ik  = GetComponent <FullBodyBipedIK>();

            // Disable the IK components to manage their updating
            aim.Disable();
            ik.Disable();

            fpsCamDefaultRot = firstPersonCam.transform.localRotation;
        }
Esempio n. 7
0
        public float offset = 0.2f;        // The greater the offset, the sooner the shoulder will start rotating

        void LateUpdate()
        {
            if (ik == null)
            {
                return;
            }
            if (ik.enabled)
            {
                ik.Disable();
            }

            // We need to update FFBIK first, so we get the more-or-less pose and we know how the chest of the character is rotated. We can calculate shoulder rotation offset based on that.

            ik.solver.Update();                                          // Update the FBBIK once. You might want to set ShoulderRotator's script execution order to execute after any other script that you have.

            RotateShoulder(FullBodyBipedChain.LeftArm, weight, offset);  // Rotate the left shoulder
            RotateShoulder(FullBodyBipedChain.RightArm, weight, offset); // Rotate the right shoulder

            ik.solver.Update();                                          // Update FBBIK again with the rotated shoulders
        }
        protected override void Start()
        {
            base.Start();

            // Find the IK components
            aim = GetComponent <AimIK>();
            ik  = GetComponent <FullBodyBipedIK>();

            // Disable the IK components to manage their updating
            aim.Disable();
            ik.Disable();

            // Presuming head is rotated towards character forward at Start
            headLookAxis = ik.references.head.InverseTransformVector(ik.references.root.forward);

            fpsCamDefaultRot = firstPersonCam.transform.localRotation;

            // Enable the upper-body aiming pose
            animator.SetLayerWeight(1, 1f);
        }
    public MovementManager(BjjPlayer bjjPlayer) //TODO: really we should be passing a subclass of BjjPlayer here
    {
        _player = bjjPlayer;
        _ik     = _player.GetComponentInChildren <FullBodyBipedIK>();
        _is     = _player.GetComponentInChildren <InteractionSystem>();
        _ik.Disable();

        leftHand      = new BodyPoint(SearchHierarchyForBone(_player.transform, "L Wrist").gameObject, FullBodyBipedEffector.LeftHand);
        rightHand     = new BodyPoint(SearchHierarchyForBone(_player.transform, "R Hand GP").gameObject, FullBodyBipedEffector.RightHand);
        leftFoot      = new BodyPoint(null, FullBodyBipedEffector.LeftFoot);
        rightFoot     = new BodyPoint(null, FullBodyBipedEffector.RightFoot);
        leftThigh     = new BodyPoint(null, FullBodyBipedEffector.LeftThigh);
        rightThigh    = new BodyPoint(null, FullBodyBipedEffector.RightThigh);
        leftShoulder  = new BodyPoint(null, FullBodyBipedEffector.LeftShoulder);
        rightShoulder = new BodyPoint(null, FullBodyBipedEffector.RightShoulder);
        body          = new BodyPoint(null, FullBodyBipedEffector.Body);

        BodyPoints = new List <BodyPoint> {
            leftHand, rightHand, leftFoot, rightFoot, leftThigh, rightThigh, leftShoulder, rightShoulder, body
        };
    }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     itemHeld = false;
     ik.Disable();
 }
 public void Initiate()
 {
     // Disable the FBBIK component to manage its updating
     ik.Disable();
 }