示例#1
0
    IEnumerator AfterInit(Action <int> process)
    {
        process(40);
        yield return(null);

        //加载游戏配置数据
        Action onGameDataReady = () =>
        {
            lock (MogoWorld.GameDataLocker)
            {
                MogoWorld.IsGameDataReady = true;
                if (MogoWorld.OnGameDataReady != null)
                {
                    Driver.Invoke(MogoWorld.OnGameDataReady);
                }
            }
        };

        GameDataControler.Init(null, onGameDataReady);
        process(45);
        yield return(null);

        //初始化网络模块
        ServerProxy.Instance.Init();
        ServerProxy.Instance.BackToChooseServer = MogoWorld.BackToChooseCharacter;
        process(50);
        yield return(null);

        //启动游戏逻辑
        MogoWorld.Init();
        SoundManager.Init();
        MogoWorld.Start();
        NPCManager.Init();
    }
示例#2
0
    void Start()
    {
        type         = "NPC";
        theTransform = transform;
        temp         = gameObject;

        if (AvatarModelData.dataMap == null)
        {
            GameDataControler.Init();
        }

        if (!AvatarModelData.dataMap.ContainsKey(mode_i) && mode_i != 150000)
        {
            Debug.Log("mode_i wrong: " + mode_i);
            return;
        }

        Debug.Log("mode_i: " + AvatarModelData.dataMap[mode_i].prefabName);

        if (mode_i != 150000)
        {
            AssetCacheMgr.GetNoCacheInstance(AvatarModelData.dataMap[mode_i].prefabName,
                                             (prefab, guid, go) =>
            {
                if (go == null)
                {
                    Debug.Log("prefabName wrong");
                }
                temp = go as GameObject;
                temp.transform.position = transform.position;
                temp.transform.rotation = transform.rotation;
            });
        }
        else
        {
            temp.transform.position = transform.position;
            temp.transform.rotation = transform.rotation;
        }

        mapx_i     = temp.transform.position.x;
        mapy_i     = temp.transform.position.z;
        rotation_l = (new Vector3(transform.rotation.x, transform.rotation.y, transform.rotation.z)).ToString();
    }
示例#3
0
        public void Initialize()
        {
            controller     = new GameDataControler();
            proxy          = new GameDataProxy(gameCenter);
            _userDataProxy = new UserDataProxy();
            user1          = new User(1, "test1", "mo", "1234", 0, 5000, "*****@*****.**");
            user2          = new User(2, "test2", "no", "1234", 0, 5000, "*****@*****.**");
            user3          = new User(3, "test3", "3test", "1234", 0, 5000, "*****@*****.**");
            _userDataProxy.AddNewUser(user1);
            _userDataProxy.AddNewUser(user2);
            _userDataProxy.AddNewUser(user3);
            useCommunication     = false;
            roomID               = 9999;
            players              = new List <Player>();
            player1              = new Player(user1, 1000, roomID);
            player1.RoundChipBet = 22;
            players.Add(player1);
            Decorator deco = SetDecoratoresNoLimitWithSpectatores();

            gameRoom = new GameRoom(players, roomID, deco, gameCenter, logControl, replayManager, ses);
        }
示例#4
0
 public GameDataProxy(GameCenter gc)
 {
     _controller = new GameDataControler();
     _gc         = gc;
 }