コード例 #1
0
ファイル: EnemyAi.cs プロジェクト: Canni6/RizzTDgame
    // Use this for initialization
    void Start()
    {
        gameManager     = GameObject.Find("GameManager");
        gameManagerRef  = gameManager.GetComponent <GameManager>();
        soundManager    = gameManager.GetComponent <SoundManager>();
        waypointGO      = GameObject.Find("Waypoints");
        spawner         = gameManager.GetComponent <SpawnerScript>();
        speed           = spawner.getCurrentWave().getSpeed();
        healthMax       = spawner.getCurrentWave().getHealth();
        health          = healthMax;
        waypointCount   = waypointGO.transform.childCount;
        healthBar       = (GameObject)Resources.Load("Prefabs/healthBar");
        healthBarOffset = new Vector3(0.0f, 5.0f, 0.0f);

        healthBar      = Instantiate(healthBar, transform);
        healthBarScale = new Vector3(health / healthMax, healthBar.transform.localScale.y, healthBar.transform.localScale.z);
        healthBar.transform.position = transform.position + healthBarOffset;
    }
コード例 #2
0
 public void updateWaveString()
 {
     currentWaveString = "Current wave: " + spawner.getCurrentWave().getName();
 }