mirror of
https://gitee.com/ruanwujing/green-pack-cocos
synced 2025-10-09 16:46:17 +00:00
工作流创建
This commit is contained in:
28
assets/scripts/testComponents/testWorkFlow.ts
Normal file
28
assets/scripts/testComponents/testWorkFlow.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { _decorator, Component, Node, tween, v3 } from 'cc';
|
||||
import { GPDrag } from '../components/GPDrag';
|
||||
import { GPWorkFlowNode } from '../components/GPWorkFlow';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('testWorkFlow')
|
||||
export class testWorkFlow extends Component {
|
||||
start() {
|
||||
let drag = this.getComponent(GPDrag)
|
||||
let testNode = new GPWorkFlowNode();
|
||||
let self = this;
|
||||
testNode.OnStart = (wfNode:GPWorkFlowNode)=>{
|
||||
tween(self.node).by(0.05, {position:v3(10, 0, 0)})
|
||||
.by(0.1, {position:v3(-20, 0, 0)})
|
||||
.by(0.05, {position:v3(10, 0, 0)})
|
||||
.call(()=>{
|
||||
wfNode.done()
|
||||
}).start()
|
||||
}
|
||||
drag.backHomeWorkFlow.insertHeadNode(testNode);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
9
assets/scripts/testComponents/testWorkFlow.ts.meta
Normal file
9
assets/scripts/testComponents/testWorkFlow.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e29b8017-2918-4c92-abc1-420a6c0834d7",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user