Пример #1
0
    private void grabModels()
    {
        MultiDimensionalObject currentDrop = GameManager.instance.getCurrentDrops();

        cubeModels    = new GameObject[maxColours];
        starModels    = new GameObject[maxColours];
        diamondModels = new GameObject[maxColours];

        for (int i = 0; i < maxColours; i++)
        {
            cubeModels [i] = currentDrop.objects [i];             // we store the cubes from 0 to 2
            cubeModels[i].GetComponent <Rigidbody2D>().gravityScale = gravityScale;

            starModels [i] = currentDrop.objects[i + 3];              // we store the stars from 3 to 5
            starModels[i].GetComponent <Rigidbody2D>().gravityScale = gravityScale;

            diamondModels[i] = currentDrop.objects[i + 6];             // we store the diamons from 6 to 8
            diamondModels[i].GetComponent <Rigidbody2D>().gravityScale = gravityScale;

            // settings gravity scale for all the models even special drops
            rainDrops[i].GetComponent <Rigidbody2D> ().gravityScale    = gravityScale;
            timeDrops[i].GetComponent <Rigidbody2D> ().gravityScale    = gravityScale;
            unifiedDrops[i].GetComponent <Rigidbody2D> ().gravityScale = gravityScale;
        }

        // settings gravity scale for all the models even special drops
        coin.GetComponent <Rigidbody2D> ().gravityScale = gravityScale;
    }
Пример #2
0
    private void populateShowDataUIWithModels()
    {
        // getting current drops -> sprites
        MultiDimensionalObject currentDrops = GameManager.instance.getCurrentDrops();

        changeShowDataUI(currentDrops.objects [0].GetComponent <SpriteRenderer> ().sprite,
                         currentDrops.objects [4].GetComponent <SpriteRenderer> ().sprite,
                         currentDrops.objects [8].GetComponent <SpriteRenderer> ().sprite,
                         CUBE_DESCRIPTION, STAR_DESCRIPTION, DIAMOND_DESCRIPTION);
    }