Esempio n. 1
0
    public override void OnEnter()
    {
        base.OnEnter();
        if (ForwardDirectionArrow.Singleton == null)
        {
            new ForwardDirectionArrow();
        }
        //主角色
        {
            MainPlayer chief = ActorManager.Singleton.Chief;
            if (chief == null)
            {
                chief = ActorManager.Singleton.CreatePureActor(ActorType.enMain, (int)EnMyPlayers.enChief, Team.Singleton.Chief.Guid, Team.Singleton.Chief.IDInTable) as MainPlayer;
                ActorManager.Singleton.SetChief(chief);
                chief.IsActorExit = false;
            }
            chief.Props.SetProperty_Int32(ENProperty.vocationid, 1);
            chief.CreateNeedModels();
            if (!chief.IsActorExit)
            {
                chief.UnhideMe(new Vector3(chief.PositionX, 0, chief.PositionZ));
            }
        }
        if (!ClientNet.Singleton.IsLongConnecting)
        {//长连接,不创建角色
            //副角色
            if (null != Team.Singleton.Deputy)
            {
                MainPlayer deputy = ActorManager.Singleton.Deputy;
                if (deputy == null)
                {
                    deputy = ActorManager.Singleton.CreatePureActor(ActorType.enMain, (int)EnMyPlayers.enDeputy, Team.Singleton.Deputy.Guid, Team.Singleton.Deputy.IDInTable) as MainPlayer;
                    ActorManager.Singleton.SetDeputy(deputy);
                    deputy.IsActorExit = true;
                }
                deputy.Props.SetProperty_Int32(ENProperty.vocationid, 1);
                deputy.CreateNeedModels();
                //副角色退场
                deputy.ActorExit();
                deputy.HideMe();
            }
            //支援角色
//             if (null != Team.Singleton.Support)
//             {
//                 Player support = ActorManager.Singleton.Support;
//                 if (support == null)
//                 {
//                     support = ActorManager.Singleton.CreatePureActor(ActorType.enSwitch, (int)EnMyPlayers.enSupport, Team.Singleton.Support.Guid, Team.Singleton.Support.IDInTable) as Player;
//                     ActorManager.Singleton.SetSupport(support);
//                 }
//                 support.Props.SetProperty_Int32(ENProperty.vocationid, 5);
//                 support.CreateNeedModels();
//                 support.InitSwitchSkillUI();
//                 //支援角色隐藏
//                 support.HideMe();
//                 //停止tick
//                 ActorManager.Singleton.ReleaseActor(support.ID, false);
//             }
//             if (!GameSettings.Singleton.m_isHideChangeAndFollow)
//             {//战友角色
//                 if (null != Team.Singleton.Comrade)
//                 {
//                     Player comrade = ActorManager.Singleton.Comrade;
//                     if (comrade == null)
//                     {
//                         comrade = ActorManager.Singleton.CreatePureActor(ActorType.enFollow, (int)EnMyPlayers.enComrade, Team.Singleton.Comrade.Guid, Team.Singleton.Comrade.IDInTable) as Player;
//                         ActorManager.Singleton.SetComrade(comrade);
//                     }
//                     comrade.CreateNeedModels();
//                 }
//             }
        }
        InitGUI();
        GameTable.SwitchAnimationTable("AnimationFight");

        //摄像机就位后,再隐藏界面
        // UIStageMenu.GetInstance().HideWindow();
        //!加载场景
        SM.RandomRoomLevel.Singleton.LoadNeedResource();
        // 初始化升级数据
        LevelUp.Singleton.InitData();
        //战斗stage开始
        BattleArena.Singleton.StageStart();

        Loading.Singleton.m_conFailedNum = 0;

        Reward.Singleton.Reset();

        // 一进入战斗状态时 记录一些数据
        BattleSummary.Singleton.RecordData();

        Map.Singleton.SetMapSize();

        KillTips.Singleton.Clear();
    }