Пример #1
0
    void LoadData()
    {
        CreatWords partsInfo = GameObject.Find("CreatWords").GetComponent <CreatWords>();

        partsList  = partsInfo.GetPartsList();
        partsSet   = partsInfo.GetPartsSet();
        partsIndex = partsInfo.GetPartsIndex();
        partsNum   = partsList.Length;

        pointsMap  = partsInfo.GetPointsLists();
        partsText  = new Text[partsNum];
        pointsText = new Text[partsNum + 2];

        partsColor            = partsInfo.GetPartsColor();
        partsTransparentColor = new Color[partsNum];
        for (int i = 0; i < partsNum; i++)
        {
            partsText[i]  = GameObject.Find(partsList[i] + "Part").GetComponent <Text>();
            pointsText[i] = GameObject.Find(partsList[i] + "Points").GetComponent <Text>();

            Color tempColor = partsColor[i];
            tempColor.a = TRANSPARENT_DEGREE;
            partsTransparentColor[i] = tempColor;
            partsText[i].color       = partsTransparentColor[i];
        }
        pointsText[4] = GameObject.Find("YourPoints").GetComponent <Text>();
        pointsText[5] = GameObject.Find("MonsterPoints").GetComponent <Text>();

        partsCollected    = new bool[partsNum];
        collectedPartsNum = 0;
        collectedParts    = new string[partsNum];
    }
Пример #2
0
    void LoadData()
    {
        CreatWords partsInfo = GameObject.Find("CreatWords").GetComponent <CreatWords>();

        partsList  = partsInfo.GetPartsList();
        partsSet   = partsInfo.GetPartsSet();
        partsIndex = partsInfo.GetPartsIndex();
        partsColor = partsInfo.GetPartsColor();
        partsNum   = partsList.Length;

        wordsLists  = partsInfo.GetWordsLists();
        pointsLists = partsInfo.GetPointsLists();

        ChangeObject();

        AddChangeTime();
        AddTimeBar();

        gameObject.AddComponent <BoxCollider>();
        gameObject.GetComponent <BoxCollider>().isTrigger = true;
    }