Example #1
0
    public void CreatPlayer(string playerName, string characterName, float x, float y, bool Turn, bool havingTicket)
    {
        var newplayer = Instantiate(Resources.Load(string.Format("Prefabs/{0}", characterName)), new Vector3(x, y, 0), Quaternion.identity);

        newplayer.name = playerName;
        GameObject.Find(newplayer.name).GetComponent <CharacterDetector>().SetMyName(newplayer.name);
        var Character = new Character(this, playerName, characterName);

        PlayerList.Add(playerName, Character);
        Character.HaveTicket(havingTicket);
        gameUi.AddPlayerName(playerName);
    }