示例#1
0
 public void SetGlobType(int globIndex)
 {
     currentGlobData = allGlobData[globIndex];
     globValue       = currentGlobData.globValue;
     globBody.color  = currentGlobData.globColor;
     globColor       = currentGlobData.globColor;
     Debug.Log("My Glob color is " + currentGlobData.globColor + " and my glob value is " + currentGlobData.globValue);
 }
示例#2
0
    GlobData GetGlobType()
    {
        var random = Random.Range(0.0f, 1.0f);

        if (random > changeTypeRate)
        {
            lastType = allGlobData[UnityEngine.Random.Range(0, 5)];
        }
        return(lastType);
    }
示例#3
0
    void Start()
    {
        matchList = new List <Glob> ();
        lastType  = allGlobData[UnityEngine.Random.Range(0, 5)];
        typePool  = new List <GlobData> ();

        var i     = 0;
        var total = 100000;

        while (i < total)
        {
            typePool.Add(GetGlobType());
            i++;
        }

        Shuffle(typePool);

        CreateGrid();
    }