コード例 #1
0
 void Start()
 {
     // verticalSpeed = -(enemySpeed * Time.deltaTime);
     verticalSpeed = -enemySpeed;
     EnemyManager  = GameObject.FindWithTag("EnemyManager").GetComponent <Spawn_Enemies>();
     slowed        = false;
 }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     spawn_enemies = Player.gameObject.GetComponent <Spawn_Enemies>();
     audioData     = GetComponent <AudioSource>();
     rend          = GetComponent <Renderer>();
     light         = GetComponent <Light>();
 }
コード例 #3
0
 public void OnTriggerEnter2D(Collider2D col)
 {
     levelInfo    = GameObject.FindWithTag("Initiate").GetComponent <Initiate>();
     EnemyManager = levelInfo.currEnemySpawner.GetComponent <Spawn_Enemies>();
     if (col.gameObject.CompareTag("Enemy"))
     {
         player.health   = player.health - 1;
         HealthText.text = "" + player.health;
         toDel           = SearchEnemyList(col.gameObject);
         EnemyManager.enemyList.Remove(EnemyManager.enemyList[toDel]);
         Destroy(col.gameObject);
     }
 }
コード例 #4
0
    void Start()
    {
        towerPosition = new Vector3(xCoordinate, yCoordinate, 0f);
        player        = GameObject.FindWithTag("player").GetComponent <Player>();
        HealthText    = GameObject.Find("Health Number").GetComponent <TextMeshProUGUI>();
        MoneyText     = GameObject.Find("Money").GetComponent <TextMeshProUGUI>();
        ScoreText     = GameObject.Find("Score - Text").GetComponent <TextMeshProUGUI>();
        levelInfo     = GameObject.FindWithTag("Initiate").GetComponent <Initiate>();

        EnemyManager = levelInfo.currEnemySpawner.GetComponent <Spawn_Enemies>();
        if (EnemyManager != null)
        {
            enemyManagerExists = true;
        }
        shot = false;
    }
コード例 #5
0
 public void UpdateEnemyManager(Spawn_Enemies updateToEnemyManager)
 {
     EnemyManager = updateToEnemyManager;
 }