question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Entitas 0.47.8 incompatible with ScriptableObject

See original GitHub issue

tested in Window 7, unity 2017.3

If project contain a ScriptableObject class like this:

using UnityEngine;
[Game]
public class Configs : ScriptableObject
{
    public GameObject gameObject;
}

below error will appear after execute Jenny gen

Sequence contains no elements

and generator won’t work

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
sschmidcommented, Jan 18, 2018

Fixed in Entitas 0.47.9

1reaction
ghostcommented, Jan 18, 2018

What do you think about:

[Game]
public class ConfigsComponent : IComponent
{
    public Configs value;
}
public Configs : ScriptableObject {
<....>
}
public class LoadConfigsInitializeSystem : IInitializeSystem {
    private readonly Configs configs;
    private readonly GameContext context;
    public LoadConfigsInitializeSystem(GameContext context, Configs configs) {
        this.configs = configs;
        this.context = context;
    }
    public void Initialize() {
        context.CreateEntity().AddConfigs(configs);
    }
}

Just write a simple InitializeSystem to set your Component.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found