Exemple #1
0
 //setup connection for lobby or ingame
 public static void Connect(int port = 0)
 {
     if (port == LobbyPort)
     {
         if (lobby == null)
         {
             lobby = new ConnectionLobby(port);
         }
         else
         {
             Console.WriteLine("Already connected to port " + port);
         }
     }
     else
     {
         if (party == null)
         {
             if (port == 0)
             {
                 int randomport = GameEnvironment.Random.Next(2000, 60000);
                 party     = new ConnectionParty(randomport);
                 partyport = randomport;
             }
             else
             {
                 party     = new ConnectionParty(port);
                 partyport = port;
             }
         }
         else
         {
             Console.WriteLine("Already connected to party port " + PartyPort);
         }
     }
 }
Exemple #2
0
 void Awake()
 {
     animator             = GetComponent <Animator>();
     conLobbyComponent    = GameObject.Find("ConnectionLobby").GetComponent <ConnectionLobby>();
     searchEnemyComponent = GetComponentInChildren <SearchEnemy>();
     _animation           = GetComponent <Animation>();
 }
 private void ShowReconnectOptions()
 {
     if (SessionInformation != null)
     {
         ConnectionLobby.SetReconnect(SessionInformation.ServerIP.ToString(), SessionInformation.SessionID.ToString());
     }
     ConnectionLobby.ConnectOptions.Visible = true;
 }
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(this);
        }

        Spawn = GameObject.Find("Spawns");
        StartCoroutine(NewEnemy(countEnemy));
    }
Exemple #5
0
 void Start()
 {
     conLobbyComponent = GameObject.Find("ConnectionLobby").GetComponent <ConnectionLobby>();
 }
Exemple #6
0
 void Awake()
 {
     _conLobby   = GameObject.Find("ConnectionLobby").GetComponent <ConnectionLobby>();
     enemyHealth = maxEnemyHealth;
     Canvas      = GameObject.Find("Canvas");
 }