Ejemplo n.º 1
0
    void CreateCustomParamsLevel(CustomGameParams gameParams)
    {
        //re-build list of polygons to use correct-sided ones
        List <List <Vector3> > newPolys = new List <List <Vector3> >();

        foreach (List <Vector3> poly in polygons)
        {
            if (poly.Count >= gameParams.sidesLow && poly.Count <= gameParams.sidesHigh)
            {
                newPolys.Add(poly);
            }
        }
        polygons = newPolys;
        //create 10 levels, TODO: change level-looping structure so it can be arbitrary amount!!
        for (int i = 0; i < 10; i++)
        {
            LevelSpec customParamsLevel = ScriptableObject.CreateInstance <LevelSpec>();
            customParamsLevel.NumberOfShapes     = gameParams.shapes;
            customParamsLevel.BaseRemoveNum      = gameParams.maxRemovals;
            customParamsLevel.LevelNum           = i;
            customParamsLevel.WallSpeed          = .05f;
            customParamsLevel.BeatsPerSecond     = 2f;
            customParamsLevel.PolyRangeLow       = 0;
            customParamsLevel.PolyRangeHigh      = polygons.Count - 1;
            customParamsLevel.NextLevelThreshold = 5;
            levels[i] = customParamsLevel;
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }