Example #1
0
    void CreateEnemy(int enemySlot, Vector3 enemyPos)
    {
        SCR_enemyAI enemyInst = Instantiate(enemyObjects[enemySlot], enemyPos, Quaternion.identity) as SCR_enemyAI;

        if (enemyPos.x < 0)
        {
            SCR_main.allPlayersGroup_A.Add(enemyInst);
        }
        else
        {
            SCR_main.allPlayersGroup_B.Add(enemyInst);
            if (enemyInst.pointerObj)
            {
                enemyInst.pointerObj.SetActive(false);
            }
        }

        enemyInst.GetComponent <SCR_characterHealth>().StartUp(enemyTotal);

        enemyTotal++;
        enemyStock--;
    }