コード例 #1
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        GameDebug.Log(string.Format("Convert DotsAnimStateController:{0}", this));

        var settings = AnimSourceController.Settings.Default;

        settings.RootAnimSource = AnimSourceRoot;
        dstManager.AddComponentData(entity, settings);

        var rigDataBuffer = dstManager.AddBuffer <AnimSourceController.RigData>(entity);

        for (int i = 0; i < Rigs.Count; i++)
        {
            var rigData = new AnimSourceController.RigData
            {
                Rig     = RigDefinitionAsset.ConvertRig(Rigs[i].Rig),
                MaxDist = Rigs[i].MaxDist,
            };
            rigDataBuffer.Add(rigData);
        }

        var conversionSettings = conversionSystem.GetBuildConfigurationComponent <NetCodeConversionSettings>();
        var server             = conversionSettings != null ? conversionSettings.Target == NetcodeConversionTarget.Server :
                                 dstManager.World.GetExistingSystem <Unity.NetCode.ServerSimulationSystemGroup>() != null;
        var color = server ? Color.gray : Color.green;

        dstManager.AddComponentData(entity, new SkeletonRenderer {
            Color = color,
        });
    }
コード例 #2
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceKnockBack.Settings
        {
            animShootPose          = ClipBuilder.AnimationClipToDenseClip(animShootPose),
            animReferenceShootPose = ClipBuilder.AnimationClipToDenseClip(animReferenceShootPose),
            shootPoseMagnitude     = shootPoseMagnitude,
            shootPoseEnterSpeed    = shootPoseEnterSpeed,
            shootPoseExitSpeed     = shootPoseExitSpeed,
            positionMultiplier     = positionMultiplier,
            angleMultiplier        = angleMultiplier,
            shootPoseEnter         = shootPoseEnter.ToKeyframeCurveBlob(),
            shootPoseExit          = shootPoseExit.ToKeyframeCurveBlob(),
            rigReference           = RigDefinitionAsset.ConvertRig(RigReference),
            boneReferences         = new AnimSourceKnockBack.BoneReferences
            {
                hipBoneIndex = boneReferences.hipBoneIndex
            },
        };

        dstManager.AddComponentData(entity, settings);
        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
コード例 #3
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        settings.rigReference = RigDefinitionAsset.ConvertRig(RigReferences);
        dstManager.AddComponentData(entity, settings);
        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
コード例 #4
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        settings.RigAsset            = RigDefinitionAsset.ConvertRig(RigReference);
        settings.IkData.TargetOffset = RigidTransform.identity;

        dstManager.AddComponentData(entity, settings);
        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
コード例 #5
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceTwist.Settings();

        settings.rigReference   = RigDefinitionAsset.ConvertRig(RigReference);
        settings.boneReferences = BoneReferences;
        settings.factors        = Factors;
        settings.twistMult      = invertTwist ? -1f : 1f;

        dstManager.AddComponentData(entity, settings);
        dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
    }
コード例 #6
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        GameDebug.Log(string.Format("Convert Item:{0}", this));

        dstManager.AddComponentData(entity, Item.InputState.Default);

        AbilityCollectionAuthoring.AddAbilityComponents(entity, dstManager, conversionSystem, abilities);



        var runtimeBoneRef = RuntimeBoneReference.Default;

        runtimeBoneRef.ReferenceRig = RigDefinitionAsset.ConvertRig(attachBone2.RigAsset);
        runtimeBoneRef.BoneIndex    = attachBone2.BoneIndex;
        RigAttacher.AddRigAttacher(entity, dstManager, runtimeBoneRef);
    }
コード例 #7
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentData(entity, new AnimSource.Data());

        var settings = new AnimSourceStandIK.Settings
        {
            animTurnAngle  = animTurnAngle,
            FootIk         = FootIk,
            boneReferences = boneReferences,
            rigReference   = RigDefinitionAsset.ConvertRig(RigReferences),
        };

        dstManager.AddComponentData(entity, settings);

        if (!dstManager.HasComponent <AnimSource.AllowWrite>(entity))
        {
            dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
        }
    }