Пример #1
0
 public void UpdateData()
 {
     Coin.text = data.getCoin().ToString();
     if (data.getSkint(0) == true)
     {
         skin[0].SetActive(false);
     }
     if (data.getSkint(1) == true)
     {
         skin[1].SetActive(false);
     }
 }
Пример #2
0
    void Start()
    {
        data = GameObject.Find("DataManager").GetComponent <YsoCorp.DataManager>();
        int i = 0;

        if (data.getSkint(0) == true && data.getSkint(1) == true)
        {
            i = 2;
        }
        else if (data.getSkint(0) == true || data.getSkint(1) == true)
        {
            i = 1;
        }


        var number = Random.Range(0, i + 1);
        SkinnedMeshRenderer meshRenderer = GetComponent <SkinnedMeshRenderer>();

        Debug.Log("number : " + number);
        meshRenderer.material = mat[number];
        selected = mat[number];
    }