예제 #1
0
    public void ResetRagdoll()
    {
        //PECollision[] cols = PEUtil.GetAllCmpts<PECollision>(transform);
        //for (int n = 0; n < cols.Length; n++)
        //    GameObject.DestroyImmediate(cols[n], true);

        m_Rigibodys = PEUtil.GetCmpts <Rigidbody>(transform);
        if (m_Rigibodys != null && m_Rigibodys.Length > 0)
        {
            m_Collisions = new PECollision[m_Rigibodys.Length];
            for (int i = 0; i < m_Rigibodys.Length; i++)
            {
                PECollision[] cols = m_Rigibodys[i].gameObject.GetComponents <PECollision>();
                for (int j = 0; j < cols.Length; j++)
                {
                    if (m_Collisions[i] == null)
                    {
                        m_Collisions[i] = cols[j];
                    }
                    else
                    {
                        GameObject.DestroyImmediate(cols[j], true);
                    }
                }

                if (m_Collisions[i] == null)
                {
                    m_Collisions[i] = m_Rigibodys[i].gameObject.AddComponent <PECollision>();
                }
            }
        }
    }
예제 #2
0
    public void Reset()
    {
        transform.position = Vector3.zero;
        transform.rotation = Quaternion.identity;

        m_Bounds.SetMinMax(Vector3.zero, Vector3.zero);
        Renderer[] renders = PEUtil.GetCmpts <Renderer>(transform);
        for (int i = 0; i < renders.Length; ++i)
        {
            m_Bounds.Encapsulate(renders[i].bounds);
        }

        Collider[] colliders = PEUtil.GetCmpts <Collider>(transform);
        for (int i = 0; i < colliders.Length; ++i)
        {
            m_Bounds.Encapsulate(colliders[i].bounds);
        }

        ItemDraggingBase draggingBase = GetComponent <ItemDraggingBase>();

        if (null != draggingBase)
        {
            draggingBase.itemBounds = this;
        }
    }
    public void ResetRagdoll()
    {
        m_Alpha          = PEUtil.GetCmpt <StandardAlphaAnimator>(transform);
        m_Renderers      = PEUtil.GetCmpts <Renderer>(transform);
        m_Colliders      = PEUtil.GetCmpts <Collider>(transform);
        slaveRigidBodies = PEUtil.GetCmpts <Rigidbody>(transform);
        if (0 < slaveRigidBodies.Length)
        {
            ragdollRootBone = slaveRigidBodies[0].transform;
        }

        animFollow = GetComponent <AnimFollow_AF>();
        if (null != animFollow)
        {
            master = animFollow.master;
        }
        if (null != master)
        {
            masterRootBone = PETools.PEUtil.GetChild(master.transform, ragdollRootBone.name);
            anim           = PEUtil.GetCmpt <Animator>(master.transform);
        }
        if (m_RagdollEffect == null)
        {
            m_RagdollEffect = gameObject.AddComponent <PERagdollEffect>();
        }

        if (m_RagdollEffect != null)
        {
            m_RagdollEffect.ResetRagdoll();
        }
    }
예제 #4
0
        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();
            }
        }