/// <summary> /// Mobs are generated here and stored statically into __MobsDict.MOBS_DICT Dictionary /// </summary> private void GenerateMobs() { short mobsPerZone = 9; short maxZones = 10; short counter = 1; for (short i = 1; i != maxZones; i++) { __MobsDataStruct tempMobDataStruct = new __MobsDataStruct(); tempMobDataStruct.Mobs = new List <__MobData>(9); for (short j = 1; j != mobsPerZone + 1; j++) { __MobData mobData = new __MobData { ID = counter, LVL = counter, mmName = "mob" + counter, HP = 100f, AttackSpeed = Math.Pow(5f, 1.2f), ATTACK = 2 * counter, DEFENSE = 3 * counter, image = null }; //Debug.Log(mobData.LVL); tempMobDataStruct.Mobs.Add(mobData); ++counter; } __MobsDict.MOBS_DICT.Add(i, tempMobDataStruct); //Debug.Log(__MobsDict.MOBS_DICT[i].Mobs[i-1].mmName); } }
void Start() { //Debug.LogWarning("MobSlot.cs => zoneID: " + zoneID + " mobID " + mobID); data = new __MobData(); tempStruct = new __MobsDataStruct(); tempStruct = __MobsDict.MOBS_DICT[zoneID]; data = tempStruct.Mobs[mobID]; this.GetComponent <Button>().GetComponentInChildren <Text>().text = data.mmName; gameObject.GetComponent <Button>().onClick.AddListener(StartFight); }