Example #1
0
    public static PlayerBurrough Instantiate(Player p_owner)
    {
        // Creation of the new instance.
        GameObject _new_instance = UnityEngine.Object.Instantiate(RESOURCE) as GameObject;

        // Get the script associated with the new tile.
        PlayerBurrough _this = _new_instance.AddComponent <PlayerBurrough> ();

        // Set the common properties
        _this.m_player = p_owner;
        _this.InitSetUpTiles();

        return(_this);
    }
Example #2
0
    private void CreatePlayersBurroughs()
    {
        int i = 0;

        foreach (Pair <Player, PlayerBurrough> player in m_players)
        {
            PlayerBurrough burrough = PlayerBurrough.Instantiate(player.Key);
            player.Value = burrough;
            GameObject player_place = burrough.gameObject;
            player_place.transform.position = new Vector3(10.0f * (i / 2), 0, 0);
            player_place.transform.rotation = Quaternion.Euler(new Vector3(0, i % 2 == 0 ? 0 : 180, 0));
            ++i;
        }
    }