Skip to content

Commit

Permalink
Fix variable bind errors (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrinktofit committed Sep 16, 2021
1 parent 4cd7f26 commit d2c5cb4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cocos/core/animation/newgen-anim/graph-node.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ccclass, serializable } from 'cc.decorator';
import { OwnedBy, ownerSymbol } from './ownership';
import { BindingHost } from './parametric';
import type { Layer, PoseSubgraph, TransitionInternal } from './pose-graph';
import { EditorExtendableMixin } from '../../data/editor-extendable';
import { EditorExtendable } from '../../data/editor-extendable';
import { CLASS_NAME_PREFIX_ANIM } from '../define';
import { StateMachineComponent } from './state-machine-component';
import { remove } from '../../utils/array';
Expand All @@ -13,7 +12,7 @@ export const outgoingsSymbol = Symbol('[[Outgoing transitions]]');
export const incomingsSymbol = Symbol('[[Incoming transitions]]');

@ccclass('cc.animation.GraphNode')
export class GraphNode extends EditorExtendableMixin(BindingHost) implements OwnedBy<Layer | PoseSubgraph> {
export class GraphNode extends EditorExtendable implements OwnedBy<Layer | PoseSubgraph> {
declare [ownerSymbol]: Layer | PoseSubgraph | undefined;

@serializable
Expand Down
2 changes: 2 additions & 0 deletions cocos/core/animation/newgen-anim/pose-blend-1d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BindableNumber, bindOr } from './parametric';
import { Pose, PoseEval, PoseEvalContext } from './pose';
import { PoseBlend, PoseBlendEval, validateBlendParam } from './pose-blend';
import { blend1D } from './blend-1d';
import { VariableType } from '.';

@ccclass('cc.animation.Blender1D')
export class PoseBlend1D implements PoseBlend {
Expand Down Expand Up @@ -32,6 +33,7 @@ export class PoseBlend1D implements PoseBlend {
const initialValue = bindOr(
context,
this.param,
VariableType.NUMBER,
evaluation.setInput,
evaluation,
0,
Expand Down
3 changes: 3 additions & 0 deletions cocos/core/animation/newgen-anim/pose-blend-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Pose, PoseEvalContext } from './pose';
import { serializable, type } from '../../data/decorators';
import { BindableNumber, bindOr } from './parametric';
import { sampleFreeformCartesian, sampleFreeformDirectional, blendSimpleDirectional } from './blend-2d';
import { VariableType } from '.';

enum Algorithm {
SIMPLE_DIRECTIONAL,
Expand Down Expand Up @@ -58,13 +59,15 @@ export class PoseBlend2D implements PoseBlend {
const initialValueX = bindOr(
context,
this.paramX,
VariableType.NUMBER,
evaluation.setInput,
evaluation,
0,
);
const initialValueY = bindOr(
context,
this.paramY,
VariableType.NUMBER,
evaluation.setInput,
evaluation,
1,
Expand Down
1 change: 0 additions & 1 deletion cocos/core/animation/newgen-anim/pose-blend-direct.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { serializable } from 'cc.decorator';
import { ccclass } from '../../data/class-decorator';
import { createEval } from './create-eval';
import { parametricNum } from './parametric';
import { Pose, PoseEval, PoseEvalContext } from './pose';
import { PoseBlend, PoseBlendEval } from './pose-blend';

Expand Down

0 comments on commit d2c5cb4

Please sign in to comment.