Ejemplo n.º 1
0
    public void Call(BloodInfo.BloodType type, BloodInfo.BloodFamily familly)
    {
        LiberatePlayer();
        GameManager.inst.CallDonor(type, familly);

        Begin();
    }
Ejemplo n.º 2
0
    public void SelectType(int id)
    {
        SetColor(id);

        _bloodType = (BloodInfo.BloodType)(id + 1);

        OpenFamilly();
    }
Ejemplo n.º 3
0
    public BloodInfo BloodInfoGetRand()
    {
        BloodInfo.BloodType   type = _data.BloodTypes[Random.Range(0, _data.BloodTypes.Length)];
        BloodInfo.BloodFamily fam  = _data.BloodFamilies[Random.Range(0, _data.BloodFamilies.Length)];
        BloodInfo.BloodRhesus rhe  = (BloodInfo.BloodRhesus)Random.Range(1, 3);

        return(new BloodInfo(type, fam, rhe));
    }
Ejemplo n.º 4
0
 public void CallDonor(BloodInfo.BloodType type, BloodInfo.BloodFamily familly)
 {
     _calledDonorCount += _data.NumberOfDonorByCall;
     for (int i = 0; i < _data.NumberOfDonorByCall; i++)
     {
         BloodDonor donor = Instantiate(_bloodDonor, _bdSpawn.position, _bdSpawn.rotation);
         donor.Init(_data, new BloodInfo(type, familly, BloodInfo.BloodRhesus.None));
         donor.called = true;
         _bloodDonors.Add(donor);
     }
 }
Ejemplo n.º 5
0
    void Start()
    {
        GameData data = GameManager.inst.RequestData();

        showType = data.BloodTypes.Length > 1;
        if (!showType)
        {
            _bloodType = data.BloodTypes[0];
            SetColor((int)data.BloodTypes[0] - 1);
        }

        _sources = GetComponents <AudioSource>();
    }
Ejemplo n.º 6
0
 private void SetBloodBagUIolor(BloodInfo.BloodType type)
 {
     _type = type;
     if (type == BloodInfo.BloodType.Blood)
     {
         _duration = _data.MaxTakingBloodTime;
         _fillIcon.SetProgressionColor(_data.TakingBloodColor);
     }
     else if (type == BloodInfo.BloodType.Plasma)
     {
         _duration = _data.MaxTakingPlasmaTime;
         _fillIcon.SetProgressionColor(_data.TakingPlasmaColor);
     }
     else if (type == BloodInfo.BloodType.Platelet)
     {
         _duration = _data.MaxTakingPlateletTime;
         _fillIcon.SetProgressionColor(_data.TakingPlateletColor);
     }
 }
Ejemplo n.º 7
0
    public void SetCompatibility(BloodInfo.BloodType type)
    {
        _type.text = type.ToString();

        Sprite sprite = _sprites[(int)type - 1];

        int[] compt;
        if (type == BloodInfo.BloodType.Plasma)
        {
            compt = _plasma;
        }
        else
        {
            compt = _blood;
        }

        for (int i = 0; i < compt.Length; i++)
        {
            _images[i].gameObject.SetActive(compt[i] == 1);
            _images[i].sprite = sprite;
        }
    }