Esempio n. 1
0
 void Start()
 {
     StartCoroutine(Attack());
     audio        = GetComponent <UnitAudio>();
     myProjectile = beamPrefab.GetComponent <Projectile>();
     myEnemy      = GetComponent <Enemy>();
 }
Esempio n. 2
0
 void Start()
 {
     StartCoroutine(Attack());
     audio        = GetComponent <UnitAudio>();
     myProjectile = beamPrefab.GetComponent <Projectile>();
     myEnemy      = GetComponent <Enemy>();
     //myProjectile.SetEnemyDamage(myEnemy.difficultyMultiplier, myEnemy.bm.level);
 }
Esempio n. 3
0
 void Awake()
 {
     plan             = new Plan();
     statusController = new StatusController();
     dir          = Direction.DOWN;
     animator     = GetComponentInChildren <UnitAnimator>();
     audioManager = GetComponentInChildren <UnitAudio>();
     curHp        = maxHp;
 }
Esempio n. 4
0
    // Start is called before the first frame update
    void Start()
    {
        bm                = board.GetComponent <BoardManager>();
        boardSize         = bm.tiles.Length;
        playerCoordinates = new int[2];
        health            = maxHealth;
        bm.setPersistentHealth(health);

        audio = GetComponent <UnitAudio>();

        initialShootCD = shootCD;
        initialBombCD  = bombCD;
    }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     if (!GetComponent <Spinny>())
     {
         timeToShoot = Random.Range(0.8f, 1.5f);
     }
     //bm = board.GetComponent<BoardManager>();
     //boardSize = bm.tiles.Length;
     audio     = GetComponent <UnitAudio>();
     health   += health * difficultyMultiplier * (bm.GetLevel() - 1);
     maxHealth = health;
     //Dumb way to get the health UI to update
     LoseHealth(0);
 }
Esempio n. 6
0
 // Start is called before the first frame update
 void Start()
 {
     if (!GetComponent <Spinny>() && timeToShoot != 3.5f)
     {
         timeToShoot = Random.Range(0.8f, 1.5f);
     }
     //bm = board.GetComponent<BoardManager>();
     //boardSize = bm.tiles.Length;
     audio = GetComponent <UnitAudio>();
     EliteSpawn();
     SetLevelStats();
     //Dumb way to get the health UI to update
     LoseHealth(0);
 }
Esempio n. 7
0
    public virtual void OnEnable()
    {
        audio = GetComponent <UnitAudio>();
        Canvas healthUI = gameObject.GetComponentInChildren <Canvas>();

        if (healthUI == null)
        {
            Debug.LogError("No canvas found for health UI on " + gameObject);
        }
        else
        {
            healthScript = healthUI.GetComponent <HealthNumber>();
            if (healthScript == null)
            {
                Debug.LogError("No health script found on " + gameObject);
            }
        }
        // Set unit's health to its maximum health. Disable this if it should start at less (or more?)
        health = maxHealth;
        // This needs to be kept regardless so the value initializes.
        ChangeHealthUI(0);
    }
Esempio n. 8
0
 void Start()
 {
     StartCoroutine(Attack());
     audio = GetComponent <UnitAudio>();
 }