Search Unity

HandleSpawnSystems

Discussion in 'FPS.Sample Game' started by MrCool92, Oct 31, 2018.

  1. MrCool92

    MrCool92

    Joined:
    Jul 13, 2015
    Posts:
    26
    Is there a reason for using HandleSpawnSystems collection for handling both spawns and despawns?
    Code (CSharp):
    1. // CharacterModuleShared
    2.  
    3. public void HandleSpawns()
    4. {
    5.     m_HandleSpawnSystems.Update();
    6. }
    7.  
    8. public void HandleDepawns()
    9. {
    10.     m_HandleSpawnSystems.Update();
    11. }
    Mistake maybe? Also, in CharacterModuleServer constructor, same collection is used for spawn and despawn systems:
    Code (CSharp):
    1. // CharacterModuleServer
    2.  
    3. // Handle spawn
    4. CharacterBehaviours.CreateHandleSpawnSystems(m_world, m_HandleSpawnSystems, resourceSystem);
    5.  
    6. // Handle despawn
    7. CharacterBehaviours.CreateHandleDespawnSystems(m_world, m_HandleSpawnSystems);
    HandleDespawnSystems is just empty collection.
     
  2. Mogens_H

    Mogens_H

    Unity Technologies

    Joined:
    Mar 7, 2017
    Posts:
    20
    Good find - It is a bug. It is already fixed and will end up on github on next full release.

    As you can see we have been trying out different ways to make it easy to add new systems, but also make it easy to get and overview of ordering of systems. We are not particulary happy with any of the solutions so this is something we will put some more effort into (hopefully making it harder for me to make this kind of bug ;))
     
    MrCool92 likes this.