Exemplo n.º 1
0
        public void Initialize()
        {
            // getting game world from server
            JoinResult initInfo = m_client.Join();

            m_ownGuid   = initInfo.PlayerGuid; // assigned by server unique own identifier to identify player
            m_gameWorld = new ClientGameWorld(initInfo.LogicalSize);

            foreach (var staticObject in initInfo.StaticObjects)
            {
                m_gameWorld.AddStaticObject(staticObject);
            }

            m_gameWorldXna = new GameWorldXna(m_game, m_gameWorld, new Rectangle(0, 0, m_game.Graphics.PreferredBackBufferWidth, m_game.Graphics.PreferredBackBufferHeight));
            m_gameWorldXna.Initialize();

            m_infoPanel = new InfoPanel(m_game, m_gameWorldXna);

            #region Create plane, controller and set camera
            m_ownPlane            = XWingPlane.BasicConfiguration(new Vector(m_gameWorld.Size.Width / 2.0, m_gameWorld.Size.Height / 2.0));
            m_ownPlane.PlayerGuid = m_ownGuid;

            m_gameWorld.AddPlaneController(new LocalPlaneController(m_ownPlane));

            m_gameWorldXna.CenterOfViewGameObject = m_ownPlane;
            m_gameWorldXna.ForceSetCameraOnCenterOfView();
            #endregion

            m_synchronizer = new ObjectsSynchronizer(m_client, m_gameWorld, m_ownGuid, m_ownPlane);

            m_gameWorld.AddGameObject(m_ownPlane); // Add after subscribing of GameWorld events

            m_infoPanel.PlaneInfoPanel.Plane = m_ownPlane;
            m_infoPanel.Initialize();
        }
Exemplo n.º 2
0
    void ToInfoPanel(PersonalInfo friend)
    {
        GameAudio.instance.PlayAudioSourceUI("click_btn");
        InfoPanel infoPanel = InfoPanel.Open();

        infoPanel.Initialize(friend);
    }
Exemplo n.º 3
0
    List <GameObject> friends = new List <GameObject>(); //好友列表

    void Start()                                         //是函数,启动时我们只执行一次,里面的循环体不受影响
    {
        //Debug.Log("到主界面:");
        friendPrefb   = (GameObject)Resources.Load("Prefabs/MMenu/FriendProb"); //动态加载好友预制件
        msgCount_preb = (GameObject)Resources.Load("Prefabs/MMenu/msgCount");   //msgCount_preb预制件
        rank_preb     = (GameObject)Resources.Load("Prefabs/MMenu/Rank_item");  //排行榜预制件加载
        RankCommand.Rank_Send();                                                //获取排行榜命令
        DisplayMyInfo();

        myInfo_B.onClick.AddListener(() => {
            GameAudio.instance.PlayAudioSourceUI("click_btn");
            InfoPanel infoPanel = InfoPanel.Open();
            infoPanel.Initialize(NetStart.myInfo);
        });//转到个人的详细信息界面

        creatRoom_B.onClick.AddListener(() => {
            GameAudio.instance.PlayAudioSourceUI("click_btn");
            //执行查找房间命令
            RoomCommand.SelectRooms();
            MMunePanel.Close();
            RoomsHallPanel.Open();
        });

        msgCount_B.onClick.AddListener(() => ToChatPanel(null));

        setting_B.onClick.AddListener(() => {
            GameAudio.instance.PlayAudioSourceUI("click_btn");
            SettingPanel.Open();
        });
        store_B.onClick.AddListener(() => {
            GameAudio.instance.PlayAudioSourceUI("click_btn");
            //Close();
        });
        SelectFriendCommand.SelectFriendList();
    }
Exemplo n.º 4
0
 public void DisplayInfoPanel(Commodity _commodity)
 {
     // if (infoPanelDisplaying) return;
     infoPanel.gameObject.SetActive(true);
     infoPanel.Initialize(_commodity);
     infoPanelDisplaying = true;
 }