示例#1
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;
            }
        }
        public void Reset()
        {
            modelController   = PEUtil.GetCmpt <PEModelController>(transform);
            ragdollController = PEUtil.GetCmpt <PERagdollController>(transform);
            ikArray           = PEUtil.GetCmpts <IK>(transform);
            ikFlashLight      = PEUtil.GetCmpt <IKFlashLight>(transform);
            fbbik             = PEUtil.GetCmpt <FullBodyBipedIK>(transform);
            grounderFBBIK     = PEUtil.GetCmpt <GrounderFBBIK>(transform);
            humanPhyCtrl      = PEUtil.GetCmpt <HumanPhyCtrl>(transform);
            ikAimCtrl         = PEUtil.GetCmpt <IKAimCtrl>(transform);
            ikAnimEffectCtrl  = PEUtil.GetCmpt <IKAnimEffectCtrl>(transform);
            ikDrive           = PEUtil.GetCmpt <IKDrive>(transform);
            defenceTrigger    = PEUtil.GetCmpt <PEDefenceTrigger>(transform);
            pathFinder        = PEUtil.GetCmpt <PEPathfinder>(transform);
            motor             = PEUtil.GetCmpt <PEMotor>(transform);
            steerAgent        = PEUtil.GetCmpt <Steer3D.SteerAgent>(transform);
            animFollow_AF     = PEUtil.GetCmpt <AnimFollow_AF>(transform);
            beatParam         = PEUtil.GetCmpt <BeatParam>(transform);
            moveParam         = PEUtil.GetCmpt <MoveParam>(transform);
            barrelController  = PEUtil.GetCmpt <PEBarrelController>(transform);
            billBoard         = PEUtil.GetCmpt <BillBoard>(transform);
            armorBones        = PEUtil.GetCmpt <ArmorBones>(transform);
            visions           = PEUtil.GetCmpts <PEVision>(transform);
            hears             = PEUtil.GetCmpts <PEHearing>(transform);
            native            = PEUtil.GetCmpt <PENative>(transform);
            monster           = PEUtil.GetCmpt <PEMonster>(transform);
            if (null != modelController)
            {
                modelController.ResetModelInfo();
            }

            if (null != animFollow_AF)
            {
                animFollow_AF.ResetModelInfo();
            }

            if (null != ragdollController)
            {
                ragdollController.ResetRagdoll();
            }
        }