Beispiel #1
0
    public void SummonDemon()
    {
        for (int i = 0; i < enemyList.Length; ++i)
        {
            //Vector3 vector3;
            //vector3 = new Vector3(groundGameObject.transform.position.x + Random.Range(-20, 20),
            //   groundGameObject.transform.position.y + 3, groundGameObject.transform.position.z + Random.Range(-20, 20));

            Vector3 vector3 = positions[i].position;

            switch (enemyList[i].ID)
            {
            case 0:
                obj = Instantiate(enemy1Prefab, vector3, Quaternion.identity);


                break;

            case 1:
                obj = Instantiate(enemy2Prefab, vector3, Quaternion.identity);

                break;

            case 2:
                obj = Instantiate(enemy3Prefab, vector3, Quaternion.identity);
                break;
            }
            Debug.Log(obj);
            if (!(obj == null))
            {
                var enemyPrefab = obj.GetComponent <EnemyPrefab>();
                enemyPrefab.GetDate(enemyList[i].LV, enemyList[i].Gold);
            }
            obj = null;
            //Destroy(enemyList[i].gameObject);
            enemyList[i].ResetDate();
            slots[i].transform.GetChild(0).GetComponent <Image>().gameObject.SetActive(false);
        }
        //  enemyList.Clear();

        enemyList = new EnemyBabyDate[25];

        for (int i = 0; i < slots.Count; i++)//エネミーリストが消えるので、もう一度読み取る。
        {
            enemyList[i] = slots[i].GetComponent <EnemyBabyDate>();
        }
        oracle.BattleStart();
    }