|
@@ -39,12 +39,11 @@ export default class AIDef extends cc.Component {
|
|
this.sprite.mRigidBody.linearDamping = 60;
|
|
this.sprite.mRigidBody.linearDamping = 60;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
update (dt) {
|
|
update (dt) {
|
|
if (this.sprite.gamePause) {
|
|
if (this.sprite.gamePause) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ this.AI()
|
|
if (this.sprite.isWalk) {
|
|
if (this.sprite.isWalk) {
|
|
let moveV2 = this.sprite.moveV2;
|
|
let moveV2 = this.sprite.moveV2;
|
|
this.sprite.mRigidBody.applyLinearImpulse(
|
|
this.sprite.mRigidBody.applyLinearImpulse(
|
|
@@ -53,6 +52,17 @@ export default class AIDef extends cc.Component {
|
|
true
|
|
true
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public AI(){
|
|
|
|
+ if(this.target && this.target.node.isValid && this.target.isActive){
|
|
|
|
+
|
|
|
|
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|