Example #1
0
    private void DrawBattle()
    {
        Debug.Log("JoinRoom");
        PhotonNetwork.playerName = PlayerName;
        RoomOptions MayRoom = new RoomOptions();

        MayRoom.MaxPlayers = 20;
        PhotonNetwork.JoinOrCreateRoom("testRoom", MayRoom, TypedLobby.Default);
        LoadingPVP.Load(LoadingScens.Game);
    }
Example #2
0
    private void onJoinPVP(bool bots = false)
    {
        Debug.Log("JoinRoom");
        PhotonNetwork.playerName = PlayerName;

        RoomOptions MayRoom = new RoomOptions();
        //  MayRoom.maxPlayers = (byte)8;
        //    MayRoom.MaxPlayers =(byte)8;
        RoomOptions roomOptions = new RoomOptions()
        {
            isVisible = true, maxPlayers = 6
        };

        roomOptions.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable();
        roomOptions.CustomRoomProperties.Add("wave", -1);

        // hash = new Hashtable();
        //  hash.Add("score", score);
        //  PhotonNetwork.player.SetCustomProperties(hash);
        NewHero nh = createHero.GetComponent <NewHero>();

        Hashtable setPlayerHW = new Hashtable()
        {
            { "HeroView", nh.myList[nh.num].ava }
        };

        PhotonNetwork.player.SetCustomProperties(setPlayerHW);

        Hashtable setPlayerLW = new Hashtable()
        {
            { "lWeapon", nh.myWeap[nh.numL].name }
        };

        PhotonNetwork.player.SetCustomProperties(setPlayerLW);

        Hashtable setPlayerRW = new Hashtable()
        {
            { "rWeapon", nh.myWeap[nh.numR].name }
        };

        PhotonNetwork.player.SetCustomProperties(setPlayerRW);
        if (bots)
        {
            PhotonNetwork.JoinOrCreateRoom("testRoom2", roomOptions, TypedLobby.Default);
            LoadingPVP.Load(LoadingScens.GameBot);
        }
        else
        {
            PhotonNetwork.JoinOrCreateRoom("testRoom", roomOptions, TypedLobby.Default);
            LoadingPVP.Load(LoadingScens.Game);
        }
    }
Example #3
0
    public void onDmg(int dmg)
    {
        Debug.Log("TOWER dmg " + dmg);
        if (GetComponent <LifeComponent>().life <= 0)
        {
            LoadingPVP.Load(LoadingScens.Menu);
            return;
        }
        GetComponent <LifeComponent>().life -= dmg;

        if (GetComponent <LifeComponent>().life <= 0)
        {
            LoadingPVP.Load(LoadingScens.Menu);
            return;
        }
    }
Example #4
0
 //подсоединились к мастеру серверу
 void OnConnectedToMaster()
 {
     //  Debug.Log("Game OnConnectedToMaster");
     LoadingPVP.Load(LoadingScens.Menu);
 }