Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     NetworkManager.AddEventListener("GetPlayersInfo", OnGetPlayersInfo);
     NetworkManager.AddEventListener("UpdatePlayerInfo", UpdatePlayerInfo);
     NetworkManager.AddEventListener("PlayerKilled", OnPlayerKilled);
     NetworkManager.AddEventListener("PlayerEquipHelmet", OnPlayerEquipHelmet);
     NetworkManager.AddEventListener("PlayerEquipClothe", OnPlayerEquipClothe);
     NetworkManager.AddEventListener("PlayerEquipWeapon", OnPlayerEquipWeapon);
     NetworkManager.AddEventListener("PlayerMagic", OnPlayerMagicBack);
     NetworkManager.AddEventListener("PlayerSuccess", OnPlayerSuccess);
     NetworkManager.AddEventListener("PlayerDead", OnPlayerDead);
     NetworkManager.AddEventListener("PlayerGetBuff", OnPlayerGetBuff);
 }
Ejemplo n.º 2
0
    protected override void InitUiOnAwake()
    {
        Btn_Leave = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Leave");
        Btn_Leave.onClick.AddListener(LeaveRoom);
        Btn_Prepare = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Prepare");


        Btn_Start = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Start");
        Btn_Start.onClick.AddListener(RequestStartGame);
        MemberList = GameTool.GetTheChildComponent <ScrollRect>(this.gameObject, "MemberList");

        NetworkManager.AddEventListener("GetRoomInfo", GetRoomInfo);
        NetworkManager.AddEventListener("StartGame", OnStartGameBack);
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        Circlefield    = GameObject.Find("CircleField");
        itemSpawnPoint = GetComponent <ItemSpawnPoint>();
        //LoadCirclefieldInfo();
        //初始化网络事件
        NetworkManager.AddEventListener("GetMapItemData", OnGetMapItemDataBack);
        NetworkManager.AddEventListener("Circlefield", OnCirclefieldBack);
        NetworkManager.AddEventListener("CirclefieldTime", OnCirclefieldTimeBack);
        NetworkManager.AddEventListener("DoorOpen", OnDoorOpen);
        NetworkManager.AddEventListener("AllPlayerLoaded", OnAllPlayerLoaded);
        NetworkManager.AddEventListener("PickItem", OnPickItem);
        NetworkManager.AddEventListener("DropItem", OnDropItem);

        //门加入字典
        for (int i = 0; i < itemSpawnPoint.DoorSpawnPoints.Length; i++)
        {
            itemSpawnPoint.DoorSpawnPoints[i].GetComponent <DoorControl>().DoorID = i;
            Doors.Add(i, itemSpawnPoint.DoorSpawnPoints[i]);
        }

        ProbabilityValue = ItemInfoManager.Instance.GetTotalOccurrenceProbability();
        ItemsID          = ItemInfoManager.Instance.GetAllItemsID();
    }
Ejemplo n.º 4
0
 protected override void InitDataOnAwake()
 {
     this.uiId = UIid.MainUI;
     NetworkManager.AddEventListener("GetRoomList", GetRoomList);
 }