示例#1
0
    void OnGetSceneInfo(NetMsgDef msg)
    {
        TSCGetSceneInfo sceneInfo = TSCGetSceneInfo.ParseFrom(msg.mBtsData);

        for (int i = 0; i < sceneInfo.BuildingInfosCount; i++)
        {
            BuildingInfo info   = sceneInfo.BuildingInfosList[i];
            BUILDING     config = sanctuaryPackage.GetBuildingConfigDataByConfigID(info.ConfigId);
            //print(string.Format("{0}, {1}", config.BldgName, info.Number));
            sanctuaryPackage.AddBuilding(info);
        }
        userPackage.SetTotalContribution(sceneInfo.TotalContribution);
        for (int i = 0; i < sceneInfo.UserInfosCount; i++)
        {
            userPackage.AddUserInfo(sceneInfo.GetUserInfos(i));
            manors[i].SetUserID(sceneInfo.GetUserInfos(i).Uid);
            manors[i].gameObject.SetActive(true);
        }
        userPackage.SetGroupName(sceneInfo.GroupName);
        SendEvent("RefreshManorLevel");
        SendEvent("RefreshBuildingView");
        SendEvent("RefreshZombieSpawner");
        SendEvent("RefreshProduceBar");
        InitManor();
    }