|
@@ -99,134 +99,6 @@
|
|
|
}
|
|
|
EventManager.instance = new Laya.EventDispatcher();
|
|
|
|
|
|
- class AssetManager {
|
|
|
- constructor() {
|
|
|
- this.Player = new ResDic();
|
|
|
- this.Enemy = new ResDic();
|
|
|
- this.Horse = new ResDic();
|
|
|
- this.Prop = new ResDic();
|
|
|
- AssetManager.ins = this;
|
|
|
- EventManager.EventOn(EventState.LoadComplete, this, this.Init);
|
|
|
- }
|
|
|
- static get Instance() {
|
|
|
- if (AssetManager.ins) {
|
|
|
- return AssetManager.ins;
|
|
|
- }
|
|
|
- else {
|
|
|
- return new AssetManager();
|
|
|
- }
|
|
|
- }
|
|
|
- Init() {
|
|
|
- this.maincamera = this.mainscene.getChildByName("Main Camera");
|
|
|
- this.Plane = this.mainscene.getChildByName("Plane");
|
|
|
- EventManager.EventTrigger(EventState.SceneInit);
|
|
|
- }
|
|
|
- }
|
|
|
- class ResourcesPath {
|
|
|
- }
|
|
|
- ResourcesPath.MainScene = "Game/res/MainScene/LayaScene_Mainscene/Conventional/Mainscene.ls";
|
|
|
- ResourcesPath.Horse = [
|
|
|
- "Game/res/Role/LayaScene_Role/Conventional/Horse.lh"
|
|
|
- ];
|
|
|
- ResourcesPath.Player = [
|
|
|
- "Game/res/Role/LayaScene_Role/Conventional/player.lh"
|
|
|
- ];
|
|
|
- ResourcesPath.Enemy = [
|
|
|
- "Game/res/Role/LayaScene_Role/Conventional/enemy.lh"
|
|
|
- ];
|
|
|
-
|
|
|
- var Sprite3D = Laya.Sprite3D;
|
|
|
- var Vector3 = Laya.Vector3;
|
|
|
- class modelConfig {
|
|
|
- constructor(model) {
|
|
|
- this.modelcur = model;
|
|
|
- this.modelPos = model.transform.position.clone();
|
|
|
- this.modelRot = model.transform.rotation.clone();
|
|
|
- this.modelSca = model.transform.scale.clone();
|
|
|
- }
|
|
|
- }
|
|
|
- class GamePool {
|
|
|
- constructor() {
|
|
|
- this.modelpool = {};
|
|
|
- this.maxAcount = 30;
|
|
|
- GamePool.Ins = this;
|
|
|
- }
|
|
|
- static get Instance() {
|
|
|
- if (GamePool.Ins) {
|
|
|
- return GamePool.Ins;
|
|
|
- }
|
|
|
- else {
|
|
|
- return new GamePool();
|
|
|
- }
|
|
|
- }
|
|
|
- GetModel(_model, title) {
|
|
|
- var poolname = title + _model.name;
|
|
|
- if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
|
|
|
- if (this.modelpool[poolname].length > 0) {
|
|
|
- var model1 = this.modelpool[poolname][0];
|
|
|
- this.modelpool[poolname].splice(0, 1);
|
|
|
- if (model1.modelcur.destroyed) {
|
|
|
- model1.modelcur = Sprite3D.instantiate(_model);
|
|
|
- if (!model1.modelcur.active) {
|
|
|
- model1.modelcur.active = true;
|
|
|
- }
|
|
|
- }
|
|
|
- model1.modelcur.active = true;
|
|
|
- model1.modelcur.transform.position = _model.transform.position.clone();
|
|
|
- model1.modelcur.transform.rotation = _model.transform.rotation.clone();
|
|
|
- model1.modelcur.transform.scale = _model.transform.scale.clone();
|
|
|
- return model1.modelcur;
|
|
|
- }
|
|
|
- else {
|
|
|
- var model = Sprite3D.instantiate(_model);
|
|
|
- model.active = true;
|
|
|
- return model;
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- var model = Sprite3D.instantiate(_model);
|
|
|
- model.active = true;
|
|
|
- return model;
|
|
|
- }
|
|
|
- }
|
|
|
- RecoveryModel(model, title = "", modelstate = false) {
|
|
|
- if (model.destroyed) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!modelstate && model.active == false) {
|
|
|
- return;
|
|
|
- }
|
|
|
- var poolname = title + model.name;
|
|
|
- if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
|
|
|
- var modelnum = this.modelpool[poolname];
|
|
|
- if (modelnum.length > this.maxAcount) {
|
|
|
- model.destroy();
|
|
|
- return;
|
|
|
- }
|
|
|
- else {
|
|
|
- modelnum.push(new modelConfig(model));
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- modelnum = [];
|
|
|
- modelnum.push(new modelConfig(model));
|
|
|
- this.modelpool[poolname] = modelnum;
|
|
|
- }
|
|
|
- model.transform.position = new Vector3(0, 0, -10000);
|
|
|
- model.removeSelf();
|
|
|
- model.active = false;
|
|
|
- }
|
|
|
- ResetsModelPool() {
|
|
|
- for (var Key in this.modelpool) {
|
|
|
- var model = this.modelpool[Key];
|
|
|
- for (var i = 0; i < model.length; i++) {
|
|
|
- model[i].modelcur.destroy();
|
|
|
- }
|
|
|
- }
|
|
|
- this.modelpool = {};
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
class GameTools {
|
|
|
constructor() {
|
|
|
GameTools.ins = this;
|
|
@@ -416,18 +288,198 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var Vector2 = Laya.Vector2;
|
|
|
+ class AssetManager {
|
|
|
+ constructor() {
|
|
|
+ this.Player = new ResDic();
|
|
|
+ this.Enemy = new ResDic();
|
|
|
+ this.Horse = new ResDic();
|
|
|
+ this.Prop = new ResDic();
|
|
|
+ AssetManager.ins = this;
|
|
|
+ EventManager.EventOn(EventState.LoadComplete, this, this.Init);
|
|
|
+ }
|
|
|
+ static get Instance() {
|
|
|
+ if (AssetManager.ins) {
|
|
|
+ return AssetManager.ins;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return new AssetManager();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Init() {
|
|
|
+ this.maincamera = this.mainscene.getChildByName("Main Camera");
|
|
|
+ this.Plane = this.mainscene.getChildByName("Plane");
|
|
|
+ GameTools.Instance.SetCollider(this.Plane, 100);
|
|
|
+ EventManager.EventTrigger(EventState.SceneInit);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ class ResourcesPath {
|
|
|
+ }
|
|
|
+ ResourcesPath.MainScene = "Game/res/MainScene/LayaScene_Mainscene/Conventional/Mainscene.ls";
|
|
|
+ ResourcesPath.Horse = [
|
|
|
+ "Game/res/Role/LayaScene_Role/Conventional/Horse.lh"
|
|
|
+ ];
|
|
|
+ ResourcesPath.Player = [
|
|
|
+ "Game/res/Role/LayaScene_Role/Conventional/player.lh"
|
|
|
+ ];
|
|
|
+ ResourcesPath.Enemy = [
|
|
|
+ "Game/res/Role/LayaScene_Role/Conventional/enemy.lh"
|
|
|
+ ];
|
|
|
+
|
|
|
+ var Sprite3D = Laya.Sprite3D;
|
|
|
+ var Vector3 = Laya.Vector3;
|
|
|
+ class modelConfig {
|
|
|
+ constructor(model) {
|
|
|
+ this.modelcur = model;
|
|
|
+ this.modelPos = model.transform.position.clone();
|
|
|
+ this.modelRot = model.transform.rotation.clone();
|
|
|
+ this.modelSca = model.transform.scale.clone();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ class GamePool {
|
|
|
+ constructor() {
|
|
|
+ this.modelpool = {};
|
|
|
+ this.maxAcount = 30;
|
|
|
+ GamePool.Ins = this;
|
|
|
+ }
|
|
|
+ static get Instance() {
|
|
|
+ if (GamePool.Ins) {
|
|
|
+ return GamePool.Ins;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return new GamePool();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ GetModel(_model, title) {
|
|
|
+ var poolname = title + _model.name;
|
|
|
+ if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
|
|
|
+ if (this.modelpool[poolname].length > 0) {
|
|
|
+ var model1 = this.modelpool[poolname][0];
|
|
|
+ this.modelpool[poolname].splice(0, 1);
|
|
|
+ if (model1.modelcur.destroyed) {
|
|
|
+ model1.modelcur = Sprite3D.instantiate(_model);
|
|
|
+ if (!model1.modelcur.active) {
|
|
|
+ model1.modelcur.active = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model1.modelcur.active = true;
|
|
|
+ model1.modelcur.transform.position = _model.transform.position.clone();
|
|
|
+ model1.modelcur.transform.rotation = _model.transform.rotation.clone();
|
|
|
+ model1.modelcur.transform.scale = _model.transform.scale.clone();
|
|
|
+ return model1.modelcur;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var model = Sprite3D.instantiate(_model);
|
|
|
+ model.active = true;
|
|
|
+ return model;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var model = Sprite3D.instantiate(_model);
|
|
|
+ model.active = true;
|
|
|
+ return model;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ RecoveryModel(model, title = "", modelstate = false) {
|
|
|
+ if (model.destroyed) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!modelstate && model.active == false) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var poolname = title + model.name;
|
|
|
+ if (this.modelpool[poolname] != null && this.modelpool[poolname] != undefined) {
|
|
|
+ var modelnum = this.modelpool[poolname];
|
|
|
+ if (modelnum.length > this.maxAcount) {
|
|
|
+ model.destroy();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ modelnum.push(new modelConfig(model));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ modelnum = [];
|
|
|
+ modelnum.push(new modelConfig(model));
|
|
|
+ this.modelpool[poolname] = modelnum;
|
|
|
+ }
|
|
|
+ model.transform.position = new Vector3(0, 0, -10000);
|
|
|
+ model.removeSelf();
|
|
|
+ model.active = false;
|
|
|
+ }
|
|
|
+ ResetsModelPool() {
|
|
|
+ for (var Key in this.modelpool) {
|
|
|
+ var model = this.modelpool[Key];
|
|
|
+ for (var i = 0; i < model.length; i++) {
|
|
|
+ model[i].modelcur.destroy();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.modelpool = {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var Vector3$1 = Laya.Vector3;
|
|
|
+ class Runner extends Laya.Script3D {
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this.currotV = new Vector3$1();
|
|
|
+ this.currot = new Laya.Quaternion;
|
|
|
+ this.NormalizeSpeed = new Vector3$1();
|
|
|
+ this.turndir = new Vector3$1(1, 0, 0);
|
|
|
+ }
|
|
|
+ static get Instance() {
|
|
|
+ if (Runner.ins) {
|
|
|
+ return Runner.ins;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return new Runner();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onAwake() {
|
|
|
+ this.m_player = this.owner;
|
|
|
+ }
|
|
|
+ onUpdate() {
|
|
|
+ }
|
|
|
+ MoveX(_speed) {
|
|
|
+ _speed *= 0.07;
|
|
|
+ this.m_player.transform.translate(new Vector3$1(_speed, 0, 0));
|
|
|
+ this.m_player.transform.position = this.m_player.transform.position.x < -4.5 ? new Vector3$1(-4.5, this.m_player.transform.position.y, this.m_player.transform.position.z) : this.m_player.transform.position;
|
|
|
+ this.m_player.transform.position = this.m_player.transform.position.x > 4.5 ? new Vector3$1(4.5, this.m_player.transform.position.y, this.m_player.transform.position.z) : this.m_player.transform.position;
|
|
|
+ }
|
|
|
+ TurnDir(_dir) {
|
|
|
+ if (_dir.x != 0) {
|
|
|
+ Vector3$1.lerp(this.currotV, _dir, 0.35, _dir);
|
|
|
+ this.currotV = _dir;
|
|
|
+ Laya.Quaternion.rotationLookAt(_dir, new Vector3$1(0, 1, 0), this.currot);
|
|
|
+ Laya.Quaternion.slerp(this.m_player.transform.rotation, this.currot, 0.025, this.currot);
|
|
|
+ this.currot = new Laya.Quaternion(0, this.currot.y, 0);
|
|
|
+ this.m_player.transform.rotation = this.currot;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Laya.Quaternion.slerp(this.m_player.transform.rotation, new Laya.Quaternion(0, 0, 0, 0), 0.1, this.currot);
|
|
|
+ this.currot = new Laya.Quaternion(0, this.currot.y, 0);
|
|
|
+ this.m_player.transform.rotation = this.currot;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var Vector2 = Laya.Vector2;
|
|
|
+ var Vector3$2 = Laya.Vector3;
|
|
|
class PlayerControl {
|
|
|
constructor() {
|
|
|
- this.mousepos = new Vector2(0, 0);
|
|
|
- this.offx = 0;
|
|
|
- this.curtouchsmoothness = 0.02;
|
|
|
- this.poschazhi = new Vector3$1();
|
|
|
- this.gengsuipos = new Vector3$1();
|
|
|
- this.lllpos = new Vector3$1();
|
|
|
+ this.DownHit = new Laya.HitResult();
|
|
|
+ this.canmove = true;
|
|
|
+ this.speed = 1;
|
|
|
+ this.press = false;
|
|
|
+ this.offset = new Vector3$2(0, 0, 0);
|
|
|
+ this.offestx = 0;
|
|
|
+ this.poschazhi = new Vector3$2();
|
|
|
+ this.gengsuipos = new Vector3$2();
|
|
|
+ this.lllpos = new Vector3$2();
|
|
|
this.hights = 0;
|
|
|
this.wights = 0;
|
|
|
+ this.rolepos = new Vector3$2;
|
|
|
+ this.rundir = new Vector3$2;
|
|
|
+ this.curspeed = 0;
|
|
|
PlayerControl.ins = this;
|
|
|
}
|
|
|
static get Instance() {
|
|
@@ -440,59 +492,91 @@
|
|
|
}
|
|
|
Init(_player) {
|
|
|
this.Player = _player;
|
|
|
- this.Player.transform.position = new Vector3$1();
|
|
|
+ this._runner = this.Player.addComponent(Runner);
|
|
|
+ this.Player.transform.position = new Vector3$2();
|
|
|
this.Camera = AssetManager.Instance.maincamera;
|
|
|
- this.Camera.transform.position = new Vector3$1(0, 15, -10);
|
|
|
- this.Camera.transform.localRotationEuler = new Vector3$1(-25, 0, 0);
|
|
|
- this.MouseListen();
|
|
|
+ this.Camera.transform.position = new Vector3$2(0, 10, -10);
|
|
|
+ this.Camera.transform.localRotationEuler = new Vector3$2(-5, 0, 0);
|
|
|
+ Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.onMouseDown);
|
|
|
+ Laya.timer.frameLoop(1, this, this.LateUpdate);
|
|
|
this.CameraFollow();
|
|
|
}
|
|
|
MouseListen() {
|
|
|
- Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.OnTouchEnter);
|
|
|
- Laya.stage.on(Laya.Event.MOUSE_UP, this, this.OnTouchOut);
|
|
|
- Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.OnTouchOut);
|
|
|
- }
|
|
|
- OnTouchEnter() {
|
|
|
- this.mousepos = new Vector2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
|
|
|
- Laya.timer.clear(this, this.OnTouchMove);
|
|
|
- Laya.timer.frameLoop(1, this, this.OnTouchMove);
|
|
|
- }
|
|
|
- OnTouchOut() {
|
|
|
- Laya.timer.clear(this, this.OnTouchMove);
|
|
|
- }
|
|
|
- OnTouchMove() {
|
|
|
- var MousePos = new Vector2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
|
|
|
- var offestX = MousePos.x - this.mousepos.x;
|
|
|
- this.offx = GameTools.Instance.lerp(this.offx, offestX, this.curtouchsmoothness);
|
|
|
- var movespeed = this.offx * 0.07;
|
|
|
- this.Player.transform.translate(new Vector3$1(-movespeed, 0, 0));
|
|
|
- this.Player.transform.position = this.Player.transform.position.x < -4.5 ? new Vector3$1(-4.5, this.Player.transform.position.y, this.Player.transform.position.z) : this.Player.transform.position;
|
|
|
- this.Player.transform.position = this.Player.transform.position.x > 4.5 ? new Vector3$1(4.5, this.Player.transform.position.y, this.Player.transform.position.z) : this.Player.transform.position;
|
|
|
- var dir = new Vector3$1(-offestX * 0.001, 0, 0);
|
|
|
- this.mousepos = MousePos;
|
|
|
+ }
|
|
|
+ onMouseDown(e) {
|
|
|
+ this.startMousePos = new Vector3$2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
|
|
|
+ var startpoint = new Laya.Vector2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
|
|
|
+ this.curMousePos1 = startpoint.clone();
|
|
|
+ Laya.timer.frameLoop(1, this, this.onMouseMove);
|
|
|
+ Laya.stage.on(Laya.Event.MOUSE_UP, this, this.onMouseUp);
|
|
|
+ Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.onMouseUp);
|
|
|
+ }
|
|
|
+ onMouseMove() {
|
|
|
+ var MousePos = new Laya.Vector2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
|
|
|
+ var offestX = MousePos.x - this.curMousePos1.x;
|
|
|
+ offestX = offestX > 100 ? 100 : offestX;
|
|
|
+ offestX = offestX < -100 ? -100 : offestX;
|
|
|
+ this.offestx = GameTools.Instance.lerp(this.offestx, offestX, 0.015);
|
|
|
+ this._runner.MoveX(-this.offestx);
|
|
|
+ var dir = new Vector3$2(-offestX * 0.005, 0, 0);
|
|
|
+ this._runner.TurnDir(dir);
|
|
|
+ this.curMousePos1 = new Vector2(MousePos.x, MousePos.y);
|
|
|
+ }
|
|
|
+ onMouseUp() {
|
|
|
+ this.offestx = 0;
|
|
|
+ Laya.timer.clear(this, this.onMouseMove);
|
|
|
}
|
|
|
CameraFollow() {
|
|
|
this.hights = 0;
|
|
|
this.wights = 0;
|
|
|
- Vector3$1.subtract(this.Player.transform.position, this.Camera.transform.position, this.poschazhi);
|
|
|
+ Vector3$2.subtract(this.Player.transform.position, this.Camera.transform.position, this.poschazhi);
|
|
|
Laya.timer.frameLoop(1, this, this.GenSui);
|
|
|
}
|
|
|
GenSui() {
|
|
|
- Vector3$1.subtract(this.Player.transform.position, this.poschazhi, this.gengsuipos);
|
|
|
+ Vector3$2.subtract(this.Player.transform.position, this.poschazhi, this.gengsuipos);
|
|
|
this.hights = GameTools.Instance.lerp(this.hights, 1.0, 0.03);
|
|
|
this.wights = GameTools.Instance.lerp(this.wights, 0.8, 0.02);
|
|
|
- this.gengsuipos = new Vector3$1(this.gengsuipos.x, this.gengsuipos.y, this.gengsuipos.z - this.wights);
|
|
|
- Vector3$1.lerp(this.Camera.transform.position, this.gengsuipos, 0.25, this.lllpos);
|
|
|
- this.lllpos = new Vector3$1(this.gengsuipos.x, this.gengsuipos.y, this.lllpos.z);
|
|
|
- this.lllpos = new Vector3$1(this.gengsuipos.x, this.lllpos.y, this.lllpos.z);
|
|
|
+ this.gengsuipos = new Vector3$2(this.gengsuipos.x, this.gengsuipos.y, this.gengsuipos.z - this.wights);
|
|
|
+ Vector3$2.lerp(this.Camera.transform.position, this.gengsuipos, 0.25, this.lllpos);
|
|
|
+ this.lllpos = new Vector3$2(this.gengsuipos.x, this.gengsuipos.y, this.lllpos.z);
|
|
|
+ this.lllpos = new Vector3$2(this.gengsuipos.x, this.lllpos.y, this.lllpos.z);
|
|
|
this.Camera.transform.position = this.lllpos;
|
|
|
var qqqwe = new Laya.Quaternion();
|
|
|
- var eyePos = new Vector3$1(this.gengsuipos.x, this.gengsuipos.y - 0.8, this.gengsuipos.z);
|
|
|
- Laya.Quaternion.lookAt(eyePos, this.Player.transform.position, new Vector3$1(0, 1, 0), qqqwe);
|
|
|
+ var eyePos = new Vector3$2(this.gengsuipos.x, this.gengsuipos.y - 0.8, this.gengsuipos.z);
|
|
|
+ Laya.Quaternion.lookAt(eyePos, this.Player.transform.position, new Vector3$2(0, 1, 0), qqqwe);
|
|
|
qqqwe.invert(qqqwe);
|
|
|
Laya.Quaternion.slerp(this.Camera.transform.rotation, qqqwe, 0.1, qqqwe);
|
|
|
this.Camera.transform.rotation = qqqwe;
|
|
|
}
|
|
|
+ get DownRayCheck() {
|
|
|
+ var isDownHit = false;
|
|
|
+ var startPos = new Vector3$2(this.Player.transform.position.x, this.Player.transform.position.y + 1.5, this.Player.transform.position.z + 0.5);
|
|
|
+ var direction = new Vector3$2(0, -1, 0);
|
|
|
+ var DownRay = new Laya.Ray(startPos, direction);
|
|
|
+ if (AssetManager.Instance.mainscene.physicsSimulation.rayCast(DownRay, this.DownHit, 100)) {
|
|
|
+ if (this.DownHit.collider.collisionGroup == 100) {
|
|
|
+ isDownHit = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return isDownHit;
|
|
|
+ }
|
|
|
+ Move() {
|
|
|
+ if (this.canmove) {
|
|
|
+ this.speed = this.press ? 1 : 0.5;
|
|
|
+ this.curspeed = GameTools.Instance.lerp(this.curspeed, this.speed, 0.04);
|
|
|
+ Vector3$2.scale(new Vector3$2(0, 0, 1), this.curspeed, this.rundir);
|
|
|
+ Vector3$2.add(this.Player.transform.position, this.rundir, this.rolepos);
|
|
|
+ Vector3$2.lerp(this.Player.transform.position, this.rolepos, 0.15, this.rolepos);
|
|
|
+ this.Player.transform.position = this.rolepos;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ RayCheck() {
|
|
|
+ if (this.DownRayCheck) {
|
|
|
+ this.Player.transform.position = new Laya.Vector3(this.Player.transform.position.x, this.DownHit.point.y, this.Player.transform.position.z);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LateUpdate() {
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class GameManager {
|
|
@@ -554,6 +638,8 @@
|
|
|
EventManager.EventTrigger(EventState.LoadComplete);
|
|
|
}
|
|
|
LoadScene() {
|
|
|
+ let abc = 0.15 * 18;
|
|
|
+ console.log("abc---", abc);
|
|
|
Laya.Scene3D.load(ResourcesPath.MainScene, Laya.Handler.create(this, (scene) => {
|
|
|
this.scene = scene;
|
|
|
AssetManager.Instance.mainscene = this.scene;
|