Exemple #1
0
    public void Initialize(MinionStats stats)
    {
        this.stats   = stats;
        stateMachine = new StateMachine(this, new IdleState());
        Animator     = GetComponent <Animator>();

        InvokeRepeating(nameof(UpdateStats), 1, 1);
    }
    public void CreateNewMinion(int age, Vector2 position, Gender gender = Gender.Random)
    {
        var minion = Instantiate(minionPrefab).GetComponent <Minion>();

        minion.transform.position = position;
        var stats = new MinionStats(minion, gender, age);

        minion.Initialize(stats);

        AddMinion(minion);
    }
    public void UpdateInfo(IStats stats)
    {
        MinionStats minionStats = (MinionStats)stats;

        gender.text = $"Gender: {minionStats.Gender}";
        age.text    = $"Age: {minionStats.Age}";
        status.text = $"Status: {minionStats.Status}";

        health.value = minionStats.Health;
        hunger.value = minionStats.Hunger;
        sanity.value = minionStats.Sanity;
    }
Exemple #4
0
 public override void Initialize()
 {
     RoamState = MinionRoamState.Inactive;
     Stats     = new MinionStats(Record);
     base.Initialize();
 }