Exemplo n.º 1
0
    private void CreateEnemy(GameObject enemyPrefab, Transform spawnTr)
    {
        GameObject g        = Instantiate(enemyPrefab);
        Starship   starship = g.GetComponent <Starship>();

        g.transform.position            = spawnTr.position;
        starship.RotationPoint.rotation = spawnTr.rotation;

        systemStarships.StarshipsTeams[enemyTeamID].AddStarship(starship);
        starship.SetFollowTarget(playerTransform);
        starship.SetAttack(true);
        starship.SetFollowEnemy(true);
        starship.DeathEvent += OnEnemyDeath;
        starship.SetLockControl(false);
    }