예제 #1
0
    protected override void ComputeComponents()
    {
        base.ComputeComponents();

        float modelX = 1.43f; // comData.dataInfo.modelX;
        float modelY = 1.9f;  // comData.dataInfo.modelY;
        float modelZ = 1.43f; // comData.dataInfo.modelZ;

        navAgent.radius = (modelX / 2) * Model.OriginalScale;
        navAgent.height = modelY * Model.OriginalScale;
        //navAgent.baseOffset = CharInfo.AirHeight;
        navAgent.baseOffset = 0f;

        UnitCollider        = gameObject.GetComponent <BoxCollider>();
        UnitCollider.size   = Vector3.Scale(new Vector3(modelX, modelY, modelZ), Model.ScaleVec3);
        UnitCollider.center = new Vector3(UnitCollider.center.x, UnitCollider.size.y * 0.5f, UnitCollider.center.z);

        if (GameDefine.skillPushTest)
        {
            if (syncData._isPartner)
            {
                //파트너면 CapsuleColider를 꺼줌
                CapsuleCollider colider = gameObject.GetComponent <CapsuleCollider>();
                colider.enabled = false;
            }
        }

        if (syncData._isPartner)
        {
            gameObject.layer = LayerMask.NameToLayer("Unit");
        }

        Radius = navAgent.radius;
        Height = UnitCollider.size.y;

        AddShadow(new Vector3(UnitCollider.size.x, UnitCollider.size.z, 1));

        // RootMotion을 위한 셋팅
        if (rootMotion != null)
        {
            string AniRMName = "";

            if (syncData._isPartner)
            {
                AniRMName = _LowDataMgr.instance.GetPartnerInfo(syncData._partnerID).prefab;
            }
            else
            {
                AniRMName = _LowDataMgr.instance.GetLowDataCostumeInfo(syncData._CostumeItem).Bodyprefab;
            }

            AssetbundleLoader.GetRMCurves(AniRMName, (dic) =>
            {
                rootMotion.Init(dic, transform, Animator.Animation, Model.FindAndCaching("Bip001"));
            });
        }
    }
예제 #2
0
    protected override void ComputeComponents()
    {
        base.ComputeComponents();

        //UnitLowData.DataInfo _data = LowDataMgr.GetUnitData(comData.Info.UnitId);
        float ModelX = 1.43f; // _data.modelX;
        float ModelY = 1.9f;  //  _data.modelY;
        float ModelZ = 1.43f; // _data.modelZ;

        navAgent.radius = (ModelX > ModelZ ? ModelX / 2 : ModelZ / 2) * Model.OriginalScale;
        navAgent.height = ModelY * Model.OriginalScale;

        BoxCollider collider = gameObject.GetComponent <BoxCollider>();

        UnitCollider    = collider;
        collider.size   = Vector3.Scale(new Vector3(ModelX * 0.9f, ModelY, ModelZ * 0.9f), Model.ScaleVec3);
        collider.center = new Vector3(UnitCollider.center.x, (collider.size.y * 0.5f), UnitCollider.center.z);

        Radius = navAgent.radius;
        Height = collider.size.y;

        //< 보스라면 안밀리도록 처리
        if (UnitType == global::UnitType.Boss || isMiddleBoss)
        {
            navAgent.avoidancePriority = 20;
            collider.isTrigger         = true;
        }

        AddShadow(new Vector3(Mathf.Max(collider.size.x, Model.OriginalScale), Mathf.Max(collider.size.z, Model.OriginalScale), 1));


        // RootMotion을 위한 셋팅
        if (rootMotion != null)
        {
            AssetbundleLoader.GetRMCurves(npcInfo.prefab, (dic) =>
            {
                rootMotion.Init(dic, transform, Animator.Animation, Model.FindAndCaching("Bip001"));
            });
        }
    }