Forum begins after the advertisement:


[Part 20] Data.BaseStats vs. CurrentStats

Home Forums Video Game Tutorial Series Creating a Rogue-like Shoot-em Up in Unity [Part 20] Data.BaseStats vs. CurrentStats

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16437
    Sean
    Level 11
    Participant
    Helpful?
    Up
    1
    ::

    Hi,

    I posted a comment last month in part 20 before I realised the forums were the best place.

    For 3C: Updating all your Weapon and Passive classes, the LightningRingWeapon and WhipWeapon scripts suddenly seem to have “data.baseStats” used, instead of “currentStats.” With the instructions to cast them to WeaponData, I went back to check where this change occurred and I couldn’t find it in any of the last seven or eight chapters since the scripts themselves were created in chapter 16.

    Was there some change not listed in the previous chapters, did I just miss something, or is it meant to be “currentStats” like it was originally. I would also assume we’d want to use the currentStats for such a thing, instead of the unaffected base stats.

    Kind Regards,
    Sean

    has upvoted this post.
    #16440
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    You’re right. If currentStats is available, we should always be using it.

    I assume you’re referring to this part?

    protected override bool Attack(int attackCount = 1)
    {
        …
    
        // Do we perform another attack?
        if (attackCount > 0)
        {
            currentAttackCount = attackCount;
            currentAttackInterval = ((WeaponData)data).baseStats.projectileInterval;
        }
    
        return true;
    }
    #16452
    Sean
    Level 11
    Participant
    Helpful?
    Up
    1
    ::

    Yes, that part.

    Good to know.
    Cheers!

    has upvoted this post.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: