| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- const GameStatesStatic = require('GameStates');
- var BarrierSuperClass = require("BarrierSuper");
- cc.Class({
- extends: BarrierSuperClass,
- properties: {
- NumOfCameIn:0,
- },
- onLoad: function () {
- },
- onCollisionEnter: function (other) {
- // return;
- if (other.node.name === 'PlayerCollisionLine')
- {
- if(this.NumOfCameIn == 0){
- this.NumOfCameIn++;
- this.ResetPerfectGradeAndAddScore(other);
- // cc.log("进了StartLine"+this.test);
- }
- // var CurrentPlayerNode = other.node.parent.parent;
- // var CurrentPlayerScript = CurrentPlayerNode.getComponent('HeroControl');
- // console.log("减速区域结束。");
- //停止减速
- // CurrentPlayerScript.ResetSpeed_noType_lerp_Stop();
- }
- },
- ResetPerfectGradeAndAddScore:function(other)//项目开始前重置perfectGrade,及显示比分
- {
- if (other.node.parent.parent.name == "Hero") {
- cc.find('Hero').getComponent('HeroControl').resetPerfectGrade();
- }
- var Level = cc.find('Level');
- Level.getComponent('LevelControl').hidePKScore(other.node.parent.parent);
- },
- GetOtherPlayer:function(CurrentPlayerNode)
- {
- var OtherPlayerNode = null;
- if (CurrentPlayerNode.name == 'Hero') {
- OtherPlayerNode = cc.find('Rivel');
- }
- else
- {
- OtherPlayerNode = cc.find('Hero');
- }
- return OtherPlayerNode;
- },
- });
|