コード例 #1
0
ファイル: GameReadyState.cs プロジェクト: CookiRui/script
    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");
        }
    }
コード例 #2
0
ファイル: LoginMsgHandle.cs プロジェクト: CookiRui/script
 public void onLoginSucceed()
 {
     if (!hasLogin)
     {
         hasLogin = true;
         LogicEvent.fire2Lua("onUserLoginOk");
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        public static void doDone(GameReadyAction actionObject)
        {
            var scene = SceneViews.instance.getCurFBScene();

            scene.setActorsAnimatorController(false);
            scene.ball.hideEnergyEffect();
            scene.recordingAnimatorState = true;
            LogicEvent.fire2Lua("onGameReady");
        }
コード例 #5
0
ファイル: FBSceneView.cs プロジェクト: CookiRui/script
    //释放焦点
    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);
    }
コード例 #6
0
ファイル: FBSceneViewBase.cs プロジェクト: CookiRui/script
    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);
    }
コード例 #7
0
ファイル: FBSceneView.cs プロジェクト: CookiRui/script
    //请求焦点
    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);
    }
コード例 #8
0
ファイル: LobbyMsgHandle.cs プロジェクト: CookiRui/script
    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);
        }
    }
コード例 #9
0
        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);
        }
コード例 #10
0
ファイル: GameEnterState.cs プロジェクト: CookiRui/script
    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;
        }
    }
コード例 #11
0
ファイル: LobbyMsgHandle.cs プロジェクト: CookiRui/script
    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();
    }
コード例 #12
0
ファイル: GameEnterState.cs プロジェクト: CookiRui/script
    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;
        }
    }
コード例 #13
0
ファイル: FBSceneViewBase.cs プロジェクト: CookiRui/script
    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);
                }
            });
        }
    }
コード例 #14
0
 public static void doDone(SettlementAction actionObject)
 {
     LogicEvent.fire2Lua("onSettlement", actionObject.winner);
 }
コード例 #15
0
        public static void doDone(GameBeginAction actionObject)
        {
            var scene = SceneViews.instance.getCurFBScene();

            LogicEvent.fire2Lua("onGameBegin");
        }
コード例 #16
0
ファイル: LoginMsgHandle.cs プロジェクト: CookiRui/script
 public void onReqTokenSucceed(ClientTokenInfo info)
 {
     clientTokenInfo            = info;
     MainCharacter.instance.uid = (uint)info.UID;
     LogicEvent.fire2Lua("onLoginSuccess");
 }
コード例 #17
0
 public static void doDone(ReplayEndAction actionObject)
 {
     RealTimeRAProcessCenter.instance.controlCenter.endReplay();
     LogicEvent.fire2Lua("onEndReplay");
 }
コード例 #18
0
 public static void doDone(UpdateScoreAction actionObject)
 {
     LogicEvent.fire2Lua("onUpdateScore", actionObject.blue, actionObject.red);
 }
コード例 #19
0
ファイル: LoginMsgHandle.cs プロジェクト: CookiRui/script
 public void onLoginFailed()
 {
     LogicEvent.fire2Lua("onUserLoginFailed");
 }
コード例 #20
0
 public static void doDone(ShowReplayLogoAction actionObject)
 {
     LogicEvent.fire2Lua("onShowReplayLogo");
 }
コード例 #21
0
 public static void doDone(UpdateCountdownAction actionObject)
 {
     LogicEvent.fire2Lua("onUpdateCountdown", actionObject.time);
 }
コード例 #22
0
 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);
 }
コード例 #23
0
ファイル: FBSceneView.cs プロジェクト: CookiRui/script
 void switchBtn(uint id)
 {
     LogicEvent.fire2Lua("onSwitchBtn", id == mainActorFrameID, getActor(id).team == mainActorTeam);
 }
コード例 #24
0
 public void onGameOver(uint tableId, ushort redScore, ushort blueScore)
 {
     LogicEvent.fire2Lua("onGameOver", tableId, redScore, blueScore);
     generateRenderAction <RAL.GameOverAction>();
 }