示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     audiomanager = GameObject.Find("AudioManager").GetComponent <AudioManager>();
     rigidBody    = GetComponent <Rigidbody2D>();
     en_spawn     = GameObject.Find("Main Camera").GetComponent <Enemy_Spawn>();
     drop_item    = GameObject.Find("Item_Spawn").GetComponent <Drop_Items>();
 }
示例#2
0
 public override void Execute(GameObject targetedEnemy)
 {
     if (spawnCount <= 0)
     {
         return;
     }
     sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <SceneManager>();
     enemySpawn   = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <Enemy_Spawn>();
     //Summon Wolf
     if (enemyList.Count < 3)
     {
         for (int i = 0; i < enemySpawn.enemySpawnPoints.Count; i++)
         {
             if (enemySpawn.enemySpawnPoints[i].childCount <= 0)
             {
                 GameObject wolfClone = Instantiate(wolfPrefab, new Vector2(enemySpawn.enemySpawnPoints[i].position.x, enemySpawn.enemySpawnPoints[i].position.y), Quaternion.identity, enemySpawn.enemySpawnPoints[i]);
                 sceneManager.enemyList.Insert(i, wolfClone);
                 sceneManager.enemyList[i].GetComponent <EnemyStats>().index = 1;
                 for (int j = 0; j < wolfClone.GetComponent <EnemyVariableManager>().skillsPrefab.Count; j++)
                 {
                     wolfClone.GetComponent <EnemyVariableManager>().skillList.Add(Instantiate(wolfClone.GetComponent <EnemyVariableManager>().skillsPrefab[j], wolfClone.transform));
                 }
                 sceneManager.playerList[0].GetComponent <PlayerVariableManager>().isTargetLockedIn = false;
                 sceneManager.playerList[1].GetComponent <PlayerVariableManager>().isTargetLockedIn = false;
                 spawnCount--;
                 return;
             }
         }
     }
 }
示例#3
0
 void Awake()
 {
     S = this;
     nextPointIndex = 1;
     enemySpwan     = Enemy_Spawn.S;
     routePath      = enemySpwan.routePath;
 }
示例#4
0
 // Start is called before the first frame update
 void Start()
 {
     audiomanager = GameObject.Find("AudioManager").GetComponent <AudioManager>();
     player       = GameObject.Find("Player");
     en_spawn     = GameObject.Find("Main Camera").GetComponent <Enemy_Spawn>();
     drop_item    = GameObject.Find("Item_Spawn").GetComponent <Drop_Items>();
     fireRateTime = 0;
     rigidBody    = GetComponent <Rigidbody2D>();
     audiomanager.Play("Common_Idle");
 }
 public void setSpawnBase(int levelNumber, int enemytospawn, int[] enemyType, float spawnTime)
 {
     spawnRate       = spawnTime;
     numberOfEnemies = enemytospawn;
     enemyTypes      = enemyType;
     spawnBase       = gameObject.AddComponent <Enemy_Spawn>() as Enemy_Spawn;
     spawnBase.forceStart(levelNumber);
     spawnBase.enemiesToSpawn = numberOfEnemies;
     spawnEmpty = false;
     timer      = new EventTimer_Base(spawnRate);
 }
 // Use this for initialization
 void Start()
 {
     Spawn1 = GameObject.Find("Enemy Spawn1").GetComponent <Enemy_Spawn>();
     Spawn2 = GameObject.Find("Enemy Spawn2").GetComponent <Enemy_Spawn>();
     Spawn3 = GameObject.Find("Enemy Spawn3").GetComponent <Enemy_Spawn>();
     Spawn4 = GameObject.Find("Enemy Spawn4").GetComponent <Enemy_Spawn>();
     Spawn5 = GameObject.Find("Enemy Spawn5").GetComponent <Enemy_Spawn>();
     Spawn6 = GameObject.Find("Enemy Spawn6").GetComponent <Enemy_Spawn>();
     Spawn7 = GameObject.Find("Enemy Spawn7").GetComponent <Enemy_Spawn>();
     Spawn8 = GameObject.Find("Enemy Spawn8").GetComponent <Enemy_Spawn>();
     StartCoroutine(Test_Level());
 }
示例#7
0
    void Start()
    {
        #region Finds
        //Procura o objeto do Spawn do inimigo e pega os scripts.
        infoenemy  = GameObject.Find("EnemySpawnPoint").GetComponent <Enemy_Spawn>();
        infowaves  = GameObject.Find("WaveController").GetComponent <Enemy_Waves>();
        infolifes  = GameObject.Find("Player").GetComponent <Player_LifeSettings>();
        infopoints = GameObject.Find("MasterControl").GetComponent <Game_PointComboControl>();
        statusdic  = GameObject.Find("StatusControl").GetComponent <Status_Dictionary>();
        statusinfo = GameObject.Find("StatusControl").GetComponent <Enemy_AI_Status>();
        //Procura o jogador para comparar mais pra frente a posição
        Player = GameObject.Find("Player");
        #endregion

        #region EnemyAssociations
        _enemyHP          = infoenemy.EnemyLibrary[gameObject.name].enemy.EnemyHP; //Coloca no dicionario o nome do inimigo e puxa o HP
        _destroyAfterPass = infoenemy.EnemyLibrary[gameObject.name].enemy.DestroyDistance;
        gameObject.tag    = "Enemy";

        EnemyPhysics      = gameObject.GetComponent <Rigidbody>();
        EnemyPhysics.mass = infoenemy.EnemyLibrary[gameObject.name].enemy.EnemyWeight;
        #endregion

        #region StatusAssociations
        Burned    = statusdic.StatusLibrary["Burn"].status;
        Wet       = statusdic.StatusLibrary["Soak"].status;
        Marked    = statusdic.StatusLibrary["Mark"].status;
        Slowed    = statusdic.StatusLibrary["Slow"].status;
        Paralyzed = statusdic.StatusLibrary["Paralyze"].status;
        None      = statusdic.StatusLibrary["Normal"].status;

        burntstatus = statusdic.StatusLibrary["Burn"].status.StatusParticle;
        wetedstatus = statusdic.StatusLibrary["Soak"].status.StatusParticle;
        markdstatus = statusdic.StatusLibrary["Mark"].status.StatusParticle;
        slowdstatus = statusdic.StatusLibrary["Slow"].status.StatusParticle;
        prlststatus = statusdic.StatusLibrary["Paralyze"].status.StatusParticle;
        nonetstatus = statusdic.StatusLibrary["Normal"].status.StatusParticle;

        current_status = statusdic.StatusLibrary["Normal"].status; //O status atual do inimigo vai ser pego da biblioteca e o atributo dela


        //print(infoenemy.EnemyLibrary[gameObject.name].enemy.EnemyType.Immunity);

        //print(gameObject.name);
        //infoenemy.EnemyLibrary[gameObject.name];
        #endregion
    }
示例#8
0
 void Start()
 {
     Spawn = gameObject.GetComponent <Enemy_Spawn>();
 }
示例#9
0
 void Awake()
 {
     S           = this;
     destination = routePath [routePath.Length - 1];
 }
示例#10
0
 void Start()
 {
     infoenemy           = GameObject.Find("EnemySpawnPoint").GetComponent <Enemy_Spawn>();
     CurrentWave         = 1;
     infoenemy.StartWave = CurrentWave;
 }