示例#1
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        if (SourceClip == null)
        {
            throw new NullReferenceException($"Error in ({this}) conversion: source clip is null.");
        }
        if (DestClip == null)
        {
            throw new NullReferenceException($"Error in ({this}) conversion: dest clip is null.");
        }

        conversionSystem.DeclareAssetDependency(gameObject, SourceClip);
        conversionSystem.DeclareAssetDependency(gameObject, DestClip);

        var blendCurve = BlobAssetReference <AnimationCurveBlob> .Null;

        if (BlendCurve != null && TransitionType == TransitionByBoolNode.TransitionType.Crossfade)
        {
            blendCurve = CurveConversion.ToAnimationCurveBlobAssetRef(BlendCurve);
        }

        dstManager.AddComponentData(entity, new InertialBlendingGraphSetup
        {
            SourceClip     = conversionSystem.BlobAssetStore.GetClip(SourceClip),
            DestClip       = conversionSystem.BlobAssetStore.GetClip(DestClip),
            TransitionType = TransitionType,
            BlendCurve     = blendCurve,
        });

        dstManager.AddComponent <DeltaTime>(entity);
    }
 public override void Build(BlobBuilder builder, ref AnimationCurveBlob data)
 {
     CurveConversion.FillAnimationCurveBlob(Value, ref builder, ref data);
 }