Пример #1
0
 void Start()
 {
     unitSelection        = FindObjectOfType <UnitSelection>();
     maxTime              = maxTime / unitSelection.difficulty.towerTimeMultiplier;
     canvas               = unitSelection.hudCanvas.transform;
     towerBars            = Instantiate(towerBarsPrefab).GetComponent <TowerBars> ();
     towerBars.canvasRect = canvas.GetComponent <RectTransform>();
     towerBars.transform.SetParent(canvas);
     towerBars.maxHealth = maxHealth;
     towerBars.maxTime   = maxTime;
     towerBars.entity    = towerBarsPosition;
     health    = maxHealth;
     time      = maxTime;
     startTime = Time.time;
     isAlive   = true;
     unitSelection.AddTower(this);
     hasPlayedSFX = false;
 }