Beispiel #1
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];
    }
Beispiel #2
0
 private void Awake()
 {
     data = GameObject.Find("DataManager").GetComponent <YsoCorp.DataManager>();
 }