Beispiel #1
0
 private IEnumerator CreatePerMonster()
 {
     while (true)
     {
         for (int j = 0; j < monsterNumPer; j++)
         {
             for (int i = 0; i < pathNum; i++)
             {
                 Transform     parent    = allMonstersGo.transform.GetChild(i);
                 GameObject    monsterGo = Instantiate(MPrefabGo);
                 RectTransform rect      = monsterGo.GetComponent <RectTransform>();
                 //Debug.LogError("monsterGo.transform.localScale: " + monsterGo.transform.localScale);
                 monsterGo.transform.SetParent(parent);
                 monsterGo.transform.localScale = monsterOriginScale;
                 Monster monster = MonsterCreator.Create(MonsterType.Base, monsterGo, i, monsterID);
                 monsterID++;
                 if (_cardEffectDelegates != null)
                 {
                     _cardEffectDelegates(i, monster);
                 }
                 if (!allMonstersDict.ContainsKey(i))
                 {
                     allMonstersDict.Add(i, new List <Monster>());
                 }
                 allMonstersDict[i].Add(monster);
             }
             yield return(new WaitForSeconds(genSpeed));
         }
         yield return(new WaitForSeconds(perIntervalTime));
     }
 }
Beispiel #2
0
 public Game(MonsterCreator creator)
 {
     _monsters = creator.Create();
 }