Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Design a Skill pool or reward pool in Dots

Discussion in 'Entity Component System' started by iamshenkui_gee, Aug 5, 2022.

  1. iamshenkui_gee

    iamshenkui_gee

    Joined:
    Apr 24, 2021
    Posts:
    30
    Has anyone ever designed a skill pool or reward pool in Unity DOTS? I am unsure what design pattern I should use for this function. Does anyone have some suggestions?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,594
    If skills amount is fixed
    You can basically use component with skills values.
    - This allow to have fixed job, which executes all relevant skills, accessing component's skills value.

    Or having multiple components, each component hosting own skill.
    - This allows to have own job per skill.

    In case your skill amount changes
    You can use dynamic buffer, which uses lets say reference to the skill type, i.e. enum, and the actual value.
    - But then, you need iterate through skills in a job, and having some switch case, to execute skill.


    Many ways you can do really. And these are not exhaustive.
    Mostly others will propose different solutions.
     
    iamshenkui_gee and bb8_1 like this.