Esempio n. 1
0
 public void Init(Drafter drafter, Unit unit, bool enabled)
 {
     this.drafter     = drafter;
     this.unit        = unit;
     this.unitEnabled = enabled;
     sprite.sprite    = unit.sprite.value;
     displayName.text = Lang.GetStr($"{unit.identifier}_DisplayName");
     toggle.isOn      = unitEnabled;
 }
Esempio n. 2
0
    private IEnumerator SendJoinRequest()
    {
        using (UnityWebRequest request = UnityWebRequest.Post(serverUrl + "draft/" + draftId + "/join", ""))
        {
            yield return(request.SendWebRequest());

            if (request.error != null)
            {
                Debug.Log("Received: " + request.downloadHandler.text);
                Debug.Log("Error While Sending: " + request.error);
            }
            else
            {
                Debug.Log("Received: " + request.downloadHandler.text);
                Drafter draftInfo = JsonUtility.FromJson <Drafter>(request.downloadHandler.text);
                drafterId = draftInfo.drafterId;
                draftType = draftInfo.draftType;
            }
        }
    }
        public void SetPlayerPool()
        {
            PlayerPoolFactory factory = new PlayerPoolFactory(divisionList, valuta);

            drafter = new Drafter(factory.GetPlayerPool());
        }