{"action":"created","issue":{"url":"https://api.github.com/repos/modesttree/Zenject/issues/68","labels_url":"https://api.github.com/repos/modesttree/Zenject/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/modesttree/Zenject/issues/68/comments","events_url":"https://api.github.com/repos/modesttree/Zenject/issues/68/events","html_url":"https://github.com/modesttree/Zenject/issues/68","id":123117245,"number":68,"title":"Initial field injection fails on MonoBehaviours attached to an inactive GameObject","user":{"login":"wizardness","id":1386509,"avatar_url":"https://avatars.githubusercontent.com/u/1386509?v=3","gravatar_id":"","url":"https://api.github.com/users/wizardness","html_url":"https://github.com/wizardness","followers_url":"https://api.github.com/users/wizardness/followers","following_url":"https://api.github.com/users/wizardness/following{/other_user}","gists_url":"https://api.github.com/users/wizardness/gists{/gist_id}","starred_url":"https://api.github.com/users/wizardness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wizardness/subscriptions","organizations_url":"https://api.github.com/users/wizardness/orgs","repos_url":"https://api.github.com/users/wizardness/repos","events_url":"https://api.github.com/users/wizardness/events{/privacy}","received_events_url":"https://api.github.com/users/wizardness/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-19T23:56:52Z","updated_at":"2015-12-20T00:21:01Z","closed_at":null,"body":"\r\n\r\nIn InstallBindings()\r\n```C#\r\n    Container.Bind<int>().ToInstance(42);\r\n```\r\nMonoBehaviour:\r\n```C#\r\n    public class Question : MonoBehaviour {\r\n    \r\n        [Inject]\r\n        protected int Answer = 3;\r\n    }\r\n```\r\nWhen that MonoBehaviour is attached to an inactive GameObject and I run the scene in the editor, the field value stays 3.  When the GameObject is active, the field value is set to 42.\r\n\r\nI'm guessing this is due to the way Unity is reluctant to let you find GameObjects that are inactive.\r\n\r\nI would expect the field value to be set to 42 whether or not the GameObject was active.\r\n"},"comment":{"url":"https://api.github.com/repos/modesttree/Zenject/issues/comments/166035375","html_url":"https://github.com/modesttree/Zenject/issues/68#issuecomment-166035375","issue_url":"https://api.github.com/repos/modesttree/Zenject/issues/68","id":166035375,"user":{"login":"svermeulen","id":810762,"avatar_url":"https://avatars.githubusercontent.com/u/810762?v=3","gravatar_id":"","url":"https://api.github.com/users/svermeulen","html_url":"https://github.com/svermeulen","followers_url":"https://api.github.com/users/svermeulen/followers","following_url":"https://api.github.com/users/svermeulen/following{/other_user}","gists_url":"https://api.github.com/users/svermeulen/gists{/gist_id}","starred_url":"https://api.github.com/users/svermeulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svermeulen/subscriptions","organizations_url":"https://api.github.com/users/svermeulen/orgs","repos_url":"https://api.github.com/users/svermeulen/repos","events_url":"https://api.github.com/users/svermeulen/events{/privacy}","received_events_url":"https://api.github.com/users/svermeulen/received_events","type":"User","site_admin":false},"created_at":"2015-12-20T00:21:01Z","updated_at":"2015-12-20T00:21:01Z","body":"There is a property on SceneCompositionRoot named \"OnlyInjectWhenActive\".  Try setting that to false.\r\n\r\nYou're not the first person to encounter this though, so I've changed it to default to this behaviour instead.  Does that address the issue?"}}