public override void enter() { game.changeCampState(game.goalTeam); FBActor mainActor = game.fbWorld.getMainActor(); var team = mainActor == null ? FBTeam.kBlue : mainActor.team; var camp = game.getCampType(team); game.onGameReady(camp); game.playersAITakeOver(false); game.resetPlayerState(); game.resetPosition(); game.changeCampState(game.goalTeam); game.fbWorld.setEnableBT(false); game.onEnableRecordInput(false); subState = SubState.Wait; if (game.preStateType == GameState.Replay) { waitTime = game.fbWorld.config.replayWaitTime; countdownTime = Fix64.Zero; } else { waitTime = Fix64.One; countdownTime = game.fbWorld.config.readyTime; if (WithoutEnterShow_4Test_EditorOnly.instance != null) { countdownTime = Fix64.Zero; } LogicEvent.fire2Lua("onFirstRound"); } }
public void onLoginSucceed() { if (!hasLogin) { hasLogin = true; LogicEvent.fire2Lua("onUserLoginOk"); } }
public static void doDone(GoalAction actionObject) { LogicEvent.fire2Rendering("onBallGoal", actionObject.team, actionObject.door, actionObject.objectID); LogicEvent.fire2Lua("onGoal", actionObject.door == Location.kLeftDoor); var scene = SceneViews.instance.getCurFBScene(); scene.recordingAnimatorState = false; scene.setActorsAnimatorController(true); }
public static void doDone(GameReadyAction actionObject) { var scene = SceneViews.instance.getCurFBScene(); scene.setActorsAnimatorController(false); scene.ball.hideEnergyEffect(); scene.recordingAnimatorState = true; LogicEvent.fire2Lua("onGameReady"); }
//释放焦点 public override void releaseFocus(ActorView actor) { base.releaseFocus(actor); SkinnedMeshRenderer smr = actor.GetComponent <SkinnedMeshRenderer>(); if (smr != null) { smr.material.SetColor("_Switch", new Color(1.0f, 0.0f, 0.0f, 1.0f)); } LogicEvent.fire("resetSkillColor", 1.0f); LogicEvent.fire2Lua("onChangeNameBindPoint", actor.id, actor.transform, -0.3f, actor.height * 1.5f); }
public virtual void ballDetach(uint id) { var actor = getActor(id); if (actor != null) { if (actor.animator != null) { actor.animator.SetBool("keepingBall", false); } ball.detach(actor); } LogicEvent.fire2Lua("onBallDetached", id); }
//请求焦点 public override void requestFocus(ActorView actor) { base.requestFocus(actor); SkinnedMeshRenderer smr = actor.GetComponentInChildren <SkinnedMeshRenderer>(); if (smr != null) { smr.material.SetColor("_Switch", new Color(0.0f, 1.0f, 0.0f, 1.0f)); } LogicEvent.fire("lerpSkillColor", 1.0f); LogicEvent.fire2Lua("onChangeNameBindPoint", actor.id, actor.getWaistPoint(), 0, actor.height); }
public void onTableUserEndNotify(TableUserEndNotify cmd) { if (cmd.playerId == MainCharacter.instance.uid) { LogicEvent.fire2Lua("onTableUserEndNotify"); #if FRAME_RECORDING if (FrameRecording.instance != null) { FrameRecording.instance.saveServerMessages(); } #endif Game.instance.deleteFBGame(); } else { Debuger.Log("其他人退出房间 : " + cmd.playerId); } }
public static void doDone(ReplayBeginAction actionObject) { RealTimeRAProcessCenter.instance.controlCenter.beginReplay( actionObject.beginFrame, actionObject.endFrame); var scene = SceneViews.instance.getCurFBScene(); scene.clearEntityStartSamplePosition(); scene.setActorsAnimatorController(false); scene.restoreActorsAnimator((int)actionObject.beginFrame); scene.ball.hideTrailEffect(); LogicEvent.fire2Lua("onBeginReplay", (uint)actionObject.goaler, actionObject.blueScore, actionObject.redScore, actionObject.goalTime, actionObject.replayTime, (byte)actionObject.goalTeam); }
public override void enter() { game.onFBGameEnter(); game.changeCampState(game.goalTeam); game.resetPosition(); game.playersAITakeOver(true); game.fbWorld.setEnableBT(true); game.onEnableRecordInput(false); if (WithoutEnterShow_4Test_EditorOnly.instance != null) { LogicEvent.fire2Lua("onEnterShowFinished", (int)game.mainActorTeam); LogicEvent.fire("onWaitForSync"); subState = SubState.WaitForSync; } else { subState = SubState.Wait; } }
public void onTableStartNotify(TableStartNotify cmd) { LogicEvent.fire2Lua("onTableStartNotify"); Game.instance.newFBGame(); Game.instance.fbGame.setupFBGame(cmd.tableId, cmd.mapId); Game.instance.fbGame.createCoach(string.Format("{0}/Resources/Config/Behaviac", UnityEngine.Application.dataPath)); cmd.allPlayerInfos.ForEach(a => { var mainCharacter = a.uid == MainCharacter.instance.uid; if (mainCharacter) { MainCharacter.instance.team = (FBTeam)a.team; } Game.instance.fbGame.createPlayer(a.uid, a.frameId, a.roleId, a.team, a.name, mainCharacter, a.ai); }); Game.instance.fbGame.fbGameCreateCompleted(); }
public override void execute(Fix64 deltaTime) { base.execute(deltaTime); switch (subState) { case SubState.Wait: if (timer < game.fbWorld.config.showEnemyMoment) { return; } var enemys = game.fbWorld.getEnemys(game.mainActorTeam, false); if (enemys != null && enemys.Count > 0) { var randomIdx = (int)(enemys.Count * (float)game.fbWorld.randomUnit); if (randomIdx >= enemys.Count) { randomIdx = enemys.Count - 1; } var randomEnemy = enemys[randomIdx]; LogicEvent.fire2Rendering("onShowEnemy", randomEnemy.id); } subState = SubState.ShowEnemy; return; case SubState.ShowEnemy: if (timer < game.fbWorld.config.enterShowTime) { return; } LogicEvent.fire2Lua("onEnterShowFinished", (int)game.mainActorTeam); LogicEvent.fire("onWaitForSync"); subState = SubState.WaitForSync; return; case SubState.WaitForSync: return; } }
public void gameInit() { setDoorNet(); if (!sceneEntityList.isNullOrEmpty()) { sceneEntityList.forEach(a => { var actor = a.Value as ActorView; if (actor == null) { return; } Color nameColor; if (actor.team == mainActorTeam) { if (actor.id == mainActorFrameID) { actor.showHalo("FeetHalo_blue"); } nameColor = new Color { r = 0, g = 97 / 255.0f, b = 255 / 255.0f, a = 1 }; } else { nameColor = new Color { r = 255 / 255.0f, g = 34 / 255.0f, b = 38 / 255.0f, a = 1 }; } if (!actor.gk) { LogicEvent.fire2Lua("onCreateActorName", actor.id, actor.transform, -0.3f, actor.height * 1.5f, actor.nickName, nameColor); } }); } }
public static void doDone(SettlementAction actionObject) { LogicEvent.fire2Lua("onSettlement", actionObject.winner); }
public static void doDone(GameBeginAction actionObject) { var scene = SceneViews.instance.getCurFBScene(); LogicEvent.fire2Lua("onGameBegin"); }
public void onReqTokenSucceed(ClientTokenInfo info) { clientTokenInfo = info; MainCharacter.instance.uid = (uint)info.UID; LogicEvent.fire2Lua("onLoginSuccess"); }
public static void doDone(ReplayEndAction actionObject) { RealTimeRAProcessCenter.instance.controlCenter.endReplay(); LogicEvent.fire2Lua("onEndReplay"); }
public static void doDone(UpdateScoreAction actionObject) { LogicEvent.fire2Lua("onUpdateScore", actionObject.blue, actionObject.red); }
public void onLoginFailed() { LogicEvent.fire2Lua("onUserLoginFailed"); }
public static void doDone(ShowReplayLogoAction actionObject) { LogicEvent.fire2Lua("onShowReplayLogo"); }
public static void doDone(UpdateCountdownAction actionObject) { LogicEvent.fire2Lua("onUpdateCountdown", actionObject.time); }
public static void doDone(UpdateMatchTimeAction actionObject) { //Debuger.Log("UpdateMatchTime frame" + actionObject.frame + " time:" + actionObject.time); //SceneViews.instance.getCurFBScene().recordFrameWithTime(actionObject.frame, actionObject.time); LogicEvent.fire2Lua("onUpdateMatchTime", actionObject.time); }
void switchBtn(uint id) { LogicEvent.fire2Lua("onSwitchBtn", id == mainActorFrameID, getActor(id).team == mainActorTeam); }
public void onGameOver(uint tableId, ushort redScore, ushort blueScore) { LogicEvent.fire2Lua("onGameOver", tableId, redScore, blueScore); generateRenderAction <RAL.GameOverAction>(); }