public void AddLife(int life) { this.Life += life; this.Life = this.Life >= MaxLife ? MaxLife : this.Life; uiData.UpdateInformation(this.Life, this.Bullets, MaxLife, MaxBullets); //Debug.Log($"Id: {this.Id} -> Vida: {this.Life}"); }
public void Constructor(int id, string name, PlataformUIData uiData, GameObject prefabExplotion) { this.Id = id; this.Name = name; this.prefabExplotion = prefabExplotion; this.uiData = uiData; uiData.SetViewActive(true); switch (id) { case 1: MaxBullets = MAX_TURRET_BULLETS; MaxLife = MAX_TURRET_LIFE; break; case 2: MaxBullets = MAX_SHOTGUN_BULLETS; MaxLife = MAX_SHOTGUN_LIFE; break; case 3: MaxBullets = MAX_FLAMETHROWER_BULLETS; MaxLife = MAX_FLAMETHROWER_LIFE; break; } AddBullet(MaxBullets); AddLife(MaxLife); uiData.UpdateInformation(this.Life, this.Bullets, MaxLife, MaxBullets); }
public void SetLife(int life) { this.Life += life; uiData.UpdateInformation(this.Life, 0, this.Id == 5 ? BASE_MAX_LIFE : MAX_LIFE, 0); //Debug.Log($"Id: {this.Id} -> Vida: {this.Life}"); }