| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- cc.Class({
- extends: cc.Component,
- properties: {
- PlayerControlScript:null,
- },
- start () {
- this.touchClick();
- this.counttest = 1;//测试数据
- this.PlayerControlScript = cc.find('HeroControl').getComponent('PlayerControl');
- },
- touchClick: function () {
- // var TouchLayout = cc.find("TouchLayout");
- var self = this;
- self.node.on(cc.Node.EventType.TOUCH_START, function (event) {
- this.TOUCH_START(true);
- }.bind(this), self.node);
- self.node.on(cc.Node.EventType.TOUCH_MOVE, function (event) {
- this.TOUCH_MOVE(true);
- }.bind(this), self.node);
- self.node.on(cc.Node.EventType.TOUCH_END, function (event) {
- this.TOUCH_END(true);
- }.bind(this), self.node);
- },
- TOUCH_START:function () {
- // cc.log('TOUCH_START',this.counttest);
- this.PlayerControlScript.PlayerAnimControl.SpeedChange();//变速
- if(this.counttest<6){
- this.counttest++;
- }
- //以下为测试数据
- // this.PlayerControlScript.PlayerAnimControl.LongJumpUpToDown();//跳远
- // this.PlayerControlScript.PlayerAnimControl.SetArmatureName('Jav');
- // this.PlayerControlScript.PlayerAnimControl.JavelinFlyToDown();//标枪飞行
- // this.PlayerControlScript.PlayerAnimControl.ThrowJavelinOut();//扔标枪
- // this.PlayerControlScript.PlayerAnimControl.JumpOutElephant();//跳下大象
- this.PlayerControlScript.PlayerAnimControl.JumpToHurdle();//跨栏
- // this.PlayerControlScript.PlayerAnimControl.JumpOnElephant();//跳上大象
- },
- TOUCH_MOVE:function () {
- // cc.log('TOUCH_MOVE');
- },
- TOUCH_END:function () {
- // cc.log('TOUCH_END');
- },
- });
|