-
-
Save j-park-serori/37c0b116feff134c7923372a716ccc8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { _decorator, Component, sp } from 'cc'; | |
const { ccclass, property } = _decorator; | |
@ccclass('SpineExample') | |
export class SpineExample extends Component { | |
@property({ type:sp.Skeleton }) | |
skel: sp.Skeleton | null = null; | |
@property({ type:sp.Skeleton }) | |
skel2: sp.Skeleton | null = null; | |
private _jitterEffect?:sp.VertexEffectDelegate; | |
start () { | |
this.skel?.setAnimation(0, "animation1", true); | |
console.log("path constraint's setting position in spine : " + this.skel?._skeleton.pathConstraints[0].position); // spineで入力したpositionの情報 | |
if (this.skel?._skeleton.pathConstraints[0].position) // set positionの1番めの方法 | |
{ | |
this.skel._skeleton.pathConstraints[0].position = 0.4; | |
} | |
console.log("path constraint's 2nd position : " + this.skel?._skeleton.pathConstraints[0].position); // set positionの1番めの方法のpositionの情報 | |
this.skel!._skeleton.pathConstraints[0].position = 0.2; // set positionの2番めの方法 | |
console.log("path constraint's 3rd position : " + this.skel?._skeleton.pathConstraints[0].position); // set positionの2番めの方法のpositionの情報 | |
} | |
// update () { | |
// } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment