41 lines
998 B
C#
41 lines
998 B
C#
using Kryz.CharacterStats.Examples;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class UnitDifficultySetter : MonoBehaviour
|
|
{
|
|
|
|
Health unitHealth;
|
|
Mana unitMana;
|
|
CharacterStats unitStats;
|
|
|
|
private UnitDifficultySettings difficultySettings;
|
|
|
|
bool initialized = false;
|
|
|
|
private void Awake()
|
|
{
|
|
initialized = false;
|
|
|
|
|
|
unitHealth = GetComponentInParent<Health>();
|
|
unitMana = GetComponentInParent<Mana>();
|
|
unitStats = GetComponentInParent<CharacterStats>();
|
|
}
|
|
|
|
public void InitializeUnitDifficulty(UnitDifficultySettings difficultySettings)
|
|
{
|
|
this.difficultySettings = difficultySettings;
|
|
|
|
unitHealth = GetComponentInParent<Health>();
|
|
unitMana = GetComponentInParent<Mana>();
|
|
unitStats = GetComponentInParent<CharacterStats>();
|
|
|
|
this.difficultySettings.SetDifficulty(ref unitHealth, ref unitMana, ref unitStats);
|
|
initialized = true;
|
|
|
|
}
|
|
|
|
}
|