Example #1
0
        public static float GetHeight(float x, float z)
        {
            BattleManager batmgr = CGameProcedure.s_BattleManager;

            if (batmgr == null)
            {
                return(0);
            }
            else
            {
                IBattle battle = batmgr.GetCurrentBattle();
                if (battle == null)
                {
                    return(0);
                }
                else
                {
                    //UScene scene = battle.GetScene();
                    //if (scene == null)
                    {
                        return(0);
                    }
                    //else
                    //{
                    //    return scene.GetHeight(x, z);
                    //}
                }
            }
        }
Example #2
0
        private void OnEnterBattle()
        {
            CGameProcedure.s_EventManager.OnPrepareOkEvent += OnLoadingBattleOk;
            SetStatus((int)BattleStatus.LoadingBattle);

            BattleType battleType = BattleType.TreasureBattle;
            IBattle    battle     = s_BattleManager.CreateBattle(battleType);

            s_BattleManager.EnterBattle(battle);
        }
Example #3
0
 public void LeaveBattle()
 {
     if (m_Battle != null)
     {
         m_Battle.Destroy();
         m_Battle = null;
         CGameProcedure.SetActiveProc(CGameProcedure.s_ProcLobby);
         CGameProcedure.SetProcedureStatus((int)LobbyStatus.None);
     }
 }
Example #4
0
 public void EnterBattle(IBattle battle)
 {
     if (battle == null)
     {
         UnityEngine.Debug.LogError("battle == null");
         return;
     }
     if (m_Battle == null)
     {
         m_Battle = battle;
         m_Battle.Init();
     }
 }
Example #5
0
        public IBattle CreateBattle(BattleType _type)
        {
            IBattle battle = null;

            switch (_type)
            {
            case BattleType.TreasureBattle:
            {
                //battle = new TreasureBattle();
                break;
            }

            default:
                break;
            }
            return(battle);
        }
Example #6
0
        private static void ClickMoveTo(Vector3 endpos)
        {
            bool closePathMoveTo = true;

            if (closePathMoveTo)
            {
                return;
            }
            IBattle battle = CGameProcedure.s_BattleManager.GetCurrentBattle();

            if (battle != null)
            {
                //UScene scene = battle.GetScene();
                //if (scene != null)
                //{
                //    Player my = CObjectManager.GetInstance().GetMySelf();
                //    if (my == null)
                //    {
                //        UnityEngine.Debug.LogError("my is null");
                //        return;
                //    }
                //    VInt3 start = my.GetPosition();
                //List<VInt3> points = scene.FindPath(start, endpos);
                //if (points != null)
                //{
                //    IFsm state = my.GetFsmMgr().GetState(CharacterState.MovePath);
                //    if (state != null && state.state == CharacterState.MovePath)
                //    {
                //        State_WalkPath wp = (State_WalkPath)state;
                //        if (wp != null)
                //        {
                //            wp.SetPos(points);
                //            my.GetFsmMgr().ChangeState(CharacterState.MovePath);

                //            List<float> xlist = wp.GetPosX();
                //            List<float> zlist = wp.GetPosZ();
                //            BattleMessage.GetInstance().ReqMovePath(my.GetID(), xlist, zlist);
                //        }
                //    }

                //}
                //}
            }
        }