private void FillEmptyDiagnostic()
    {
        int count = GemObjectList.Count;

        Debug.Log("FillEmptyDiagnostic");
        SquareGridManager.Instance.SetScanSetting(0);

        GameObject go = SquareGridManager.Instance.QueryScanNextSquare();

        while (go != null)
        {
            SquareGridObject objectScript = go.GetComponent <SquareGridObject> ();

            if (objectScript.NoGemAttached())
            {
                GameObject gem = GemManager.Instance.QueryGetAvailableObject();

                if (gem != null)
                {
                    int colorType = (int)Random.Range(0, count);

                    GemObject gemScript = gem.GetComponent <GemObject> ();
                    gemScript.SetGemSprite(GemObjectList[colorType], (GemObject.eColorType)colorType);

                    objectScript.AttachGem(gem);
                }
            }

            go = SquareGridManager.Instance.QueryScanNextSquare();
        }
    }
Beispiel #2
0
    private void FillPreconfigDiagnostic()
    {
        int count = GemObjectList.Count;

        Debug.Log("FillEmptyDiagnostic");
        HexManager.Instance.SetScanSetting(0);

        GameObject go = HexManager.Instance.QueryScanNextHex();

        int index = 0;

        while (go != null)
        {
            HexObject objectScript = go.GetComponent <HexObject> ();

            if (objectScript._Type == HexObject.eType.Main && objectScript.NoGemAttached())
            {
                GameObject gem = GemManager.Instance.QueryGetAvailableObject();

                if (gem != null)
                {
                    int colorType = PreConfigBoard3[index++];

                    GemObject gemScript = gem.GetComponent <GemObject> ();
                    gemScript.SetGemSprite(GemObjectList[colorType], (GemObject.eColorType)colorType);

                    objectScript.AttachGem(gem);
                }
            }

            go = HexManager.Instance.QueryScanNextHex();
        }
    }