Commit ab308267 authored by Games@thm's avatar Games@thm

LevelSelect fertig

parent 0995e9f8
fileFormatVersion: 2
guid: c29aa0de4bb26a945ae50fd6de53f7ec
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: MaxLevelNum
m_EditorClassIdentifier:
DeveloperDescription:
value: 5
value: 6
oldValue: 1
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
......@@ -21,14 +21,59 @@ public class SelLevelManager : MonoBehaviour
{
//LevelGrid = GameObject.FindGameObjectWithTag("SelLevelGrid");
Debug.Log("entered activateLevels");
if (counter == 0 && levelsnum.Value < 7)
{ Debug.Log("eins");
for (int i = 0; i < levelsnum.Value-(counter*7); i++)
{
for (int i = 0; i < levelsnum.Value; i++)
{
lvlaccessbtn = this.transform.GetChild(i).GetComponent<Button>();
lvlaccessbtn.interactable = true;
lvlaccessbtn = this.transform?.GetChild(i).GetComponent<Button>();
if (lvlaccessbtn!=null)
{
lvlaccessbtn.interactable = true;
}
}
}else if (counter == 1 && levelsnum.Value < 14)
{Debug.Log("zwei");
for (int i = 0; i < levelsnum.Value-7; i++)
{
lvlaccessbtn = this.transform?.GetChild(i).GetComponent<Button>();
if (lvlaccessbtn!=null)
{
lvlaccessbtn.interactable = true;
}
}
}else if (counter == 2 && levelsnum.Value < 20)
{Debug.Log("drei"+levelsnum.Value);
for (int i = 0; i < levelsnum.Value - 14; i++)
{
Debug.Log("-");
lvlaccessbtn = this.transform.GetChild(i).GetComponent<Button>();
if (lvlaccessbtn != null)
{
lvlaccessbtn.interactable = true;
}
}
}else{Debug.Log("vier");
for (int i = 0; i < 7; i++)
{
lvlaccessbtn = this.transform?.GetChild(i).GetComponent<Button>();
if (lvlaccessbtn!=null)
{
lvlaccessbtn.interactable = true;
}
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment