Ejemplo n.º 1
0
    public void RemovePlayerShip(PlayerID player)
    {
        totalPlayers--;

        ShipConfigData config = new ShipConfigData();

        config.playerID = PlayerID.none;
//		config.ship = shipType;

        switch (player)
        {
        case PlayerID.P1:
            player1Config = config;
            return;

        case PlayerID.P2:
            player2Config = config;
            return;

        case PlayerID.P3:
            player3Config = config;
            return;

        case PlayerID.P4:
            player4Config = config;
            return;
        }
    }
Ejemplo n.º 2
0
    public void SetPlayerShip(PlayerID player, ShipType shipType)
    {
        totalPlayers++;

        ShipConfigData config = new ShipConfigData();

        config.playerID = player;
        config.ship     = shipType;

        switch (player)
        {
        case PlayerID.P1:
            player1Config = config;
            return;

        case PlayerID.P2:
            player2Config = config;
            return;

        case PlayerID.P3:
            player3Config = config;
            return;

        case PlayerID.P4:
            player4Config = config;
            return;
        }
    }
Ejemplo n.º 3
0
    void SpawnShip(ShipConfigData config)
    {
        Debug.Log(planets[planetID]);
        while (!planets[planetID].playerSpawnPoints[playerSpawnID].isAvailable)
        {
            MoveSpawnPoint();
        }

//		PlayerConfig playerConfig = Instantiate(GetShipPrefab(config.ship),spawnPoints[spawnID].position, Quaternion.identity) as PlayerConfig;
        GameObject go = Instantiate(GetShipPrefab(config.ship), planets[planetID].playerSpawnPoints[playerSpawnID].gameObject.transform.position, Quaternion.identity) as GameObject;

        go.GetComponent <PlayerConfig>().Configure(config.playerID, totalPlayers);

        MoveSpawnPoint();

        //regenerate the list of players
        players = null;
        players = GameObject.FindGameObjectsWithTag("Player");
    }
Ejemplo n.º 4
0
	public void RemovePlayerShip(PlayerID player) {
		totalPlayers--;

		ShipConfigData config = new ShipConfigData();
		config.playerID = PlayerID.none;
//		config.ship = shipType;

		switch (player) {
		case PlayerID.P1:
			player1Config = config;
			return;
		case PlayerID.P2:
			player2Config = config;
			return;
		case PlayerID.P3:
			player3Config = config;
			return;
		case PlayerID.P4:
			player4Config = config;
			return;
		}
	}
Ejemplo n.º 5
0
	public void SetPlayerShip(PlayerID player, ShipType shipType) {
		totalPlayers++;

		ShipConfigData config = new ShipConfigData();
		config.playerID = player;
		config.ship = shipType;

		switch (player) {
		case PlayerID.P1:
			player1Config = config;
			return;
		case PlayerID.P2:
			player2Config = config;
			return;
		case PlayerID.P3:
			player3Config = config;
			return;
		case PlayerID.P4:
			player4Config = config;
			return;
		}

	}
Ejemplo n.º 6
0
	void SpawnShip(ShipConfigData config) {
		Debug.Log( planets[planetID]);
		while (!planets[planetID].playerSpawnPoints[playerSpawnID].isAvailable) {
			MoveSpawnPoint ();
		}
			
//		PlayerConfig playerConfig = Instantiate(GetShipPrefab(config.ship),spawnPoints[spawnID].position, Quaternion.identity) as PlayerConfig;
		GameObject go = Instantiate(GetShipPrefab(config.ship),planets[planetID].playerSpawnPoints[playerSpawnID].gameObject.transform.position, Quaternion.identity) as GameObject;

		go.GetComponent<PlayerConfig>().Configure(config.playerID, totalPlayers);

		MoveSpawnPoint();

		//regenerate the list of players
		players = null;
		players = GameObject.FindGameObjectsWithTag("Player");
	}
Ejemplo n.º 7
0
	IEnumerator SpawnDelay(ShipConfigData config) {
		yield return new WaitForSeconds(spawnDelay);

		SpawnShip(config);
	}
Ejemplo n.º 8
0
    IEnumerator SpawnDelay(ShipConfigData config)
    {
        yield return(new WaitForSeconds(spawnDelay));

        SpawnShip(config);
    }