public ResearchMain(string researchTitleTemp, int currentLevelTemp, int maxLevelTemp, List <int> moneyCostsTemp, List <int> researchCostsTemp, List <int> valueStepTemp, List <float> researchTimeTemp, rType researchTypeTemp)
 {
     researchTitle = researchTitleTemp;
     currentLevel  = currentLevelTemp;
     maxLevel      = maxLevelTemp;
     costsMoney    = moneyCostsTemp;
     costsResearch = researchCostsTemp;
     valueStep     = valueStepTemp;
     researchTime  = researchTimeTemp;
     researchType  = researchTypeTemp;
 }
    public ResearchMain (string researchTitleTemp, int currentLevelTemp, int maxLevelTemp, List<int> moneyCostsTemp, List<int> researchCostsTemp, List<int> valueStepTemp, List<float>researchTimeTemp, rType researchTypeTemp)
    {

        researchTitle = researchTitleTemp;
        currentLevel = currentLevelTemp;
        maxLevel = maxLevelTemp;
        costsMoney = moneyCostsTemp;
        costsResearch = researchCostsTemp;
        valueStep = valueStepTemp;
        researchTime = researchTimeTemp;
        researchType = researchTypeTemp;


    }
Exemple #3
0
    //private Sprite mySprite;
    //private SpriteRenderer sr;
    //GameObject gameObject;

    protected void selectType()
    {
        int val = -1;

        if (difficulty == 0)
        {
            val = (int)(Random.value * 2.0f);
        }
        else if (difficulty == 1)
        {
            val = (int)(Random.value * 3.0f);
        }
        else
        {
            val = (int)Mathf.Min((Random.value * 5.0f), 2);
        }
        val = 0;
        switch (val)
        {
        case 0:
            type = rType.regular;
            break;

        case 1:
            type = rType.swing;
            break;

        case 2:
            type = rType.random;
            break;

        case 3:
            type = rType.test;
            break;
        }
        //Debug.Log("Type: " + type);
    }
    public RhythmBlock(rType type, int length, int density, bool genEn, int offset, float level, bool pair)
    {
        this.level      = level;
        this.pair       = pair;
        generateEnemies = genEn;
        if (genEn)
        {
            enemyThreshold = 0.65f;
        }
        rhythm = new int[length];
        //Debug.Log(length + " " + density);
        int mult = length / density + offset;

        switch (type)
        {
        case rType.regular:
            for (int i = 1; i < length; i += mult)
            {
                rhythm[i] = 1;
            }
            break;

        case rType.random:
            for (int i = 1; i < length; i++)
            {
                if (rhythm[i - 1] == 1)
                {
                    continue;
                }
                if (Random.value < 0.33)
                {
                    rhythm[i] = 1;
                }
            }
            break;

        case rType.swing:
            for (int i = 1; i < length; i += mult)
            {
                rhythm[i] = 1;
                if ((i + 2 + offset) < length)
                {
                    rhythm[i + 2 + offset] = 1;
                }
            }
            break;

        case rType.test:
            break;
        }
        string otp = "Rhythm Array: [";

        for (int i = 0; i < length; i++)
        {
            otp += rhythm[i] + ", ";
        }
        otp += "]";
        //Debug.Log(otp);

        loadActionBlock();
    }