{"action":"created","issue":{"url":"https://api.github.com/repos/Kopernicus/Kopernicus/issues/91","labels_url":"https://api.github.com/repos/Kopernicus/Kopernicus/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/Kopernicus/Kopernicus/issues/91/comments","events_url":"https://api.github.com/repos/Kopernicus/Kopernicus/issues/91/events","html_url":"https://github.com/Kopernicus/Kopernicus/issues/91","id":110917371,"number":91,"title":"PQSMod Loaders that are outside of Kopernicus.dll fail to parse certain properties","user":{"login":"HappyFaceIndustries","id":7258677,"avatar_url":"https://avatars.githubusercontent.com/u/7258677?v=3","gravatar_id":"","url":"https://api.github.com/users/HappyFaceIndustries","html_url":"https://github.com/HappyFaceIndustries","followers_url":"https://api.github.com/users/HappyFaceIndustries/followers","following_url":"https://api.github.com/users/HappyFaceIndustries/following{/other_user}","gists_url":"https://api.github.com/users/HappyFaceIndustries/gists{/gist_id}","starred_url":"https://api.github.com/users/HappyFaceIndustries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HappyFaceIndustries/subscriptions","organizations_url":"https://api.github.com/users/HappyFaceIndustries/orgs","repos_url":"https://api.github.com/users/HappyFaceIndustries/repos","events_url":"https://api.github.com/users/HappyFaceIndustries/events{/privacy}","received_events_url":"https://api.github.com/users/HappyFaceIndustries/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Kopernicus/Kopernicus/labels/cantfix","name":"cantfix","color":"eb6420"},{"url":"https://api.github.com/repos/Kopernicus/Kopernicus/labels/Unity%20issue","name":"Unity issue","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-12T06:56:14Z","updated_at":"2015-10-17T15:14:24Z","closed_at":null,"body":"I've been encountering issues with my custom PQSMods: Whenever the parser loads them, any non-struct type loaders (strings, ParserTargetCollections, Texture2DLoaders, etc.) load properly, but fail to set the values in the PQSMod, so they throw NullRefs whenever they are referenced by the PQSMod. They are not null if referenced in the loader.\r\n\r\nI investigated a little bit more, and found this strange thing:\r\n\r\n![screenshot140](https://cloud.githubusercontent.com/assets/7258677/10422564/af27d23c-7081-11e5-954e-b1ec03142866.png)\r\n\r\nAfter calling UnityEngine.Resources.FindAllObjectsOfType<T>(), I found that, for whatever reason, **TWO** PQSMods were being added, which seemingly had the same parent, despite the Body.Log and GetComponentsInChildren<T>() only showing one.\r\n\r\nI then looked through the components and other properties of those two objects, and found that 1 of them DID have the correct properties passed by the Loader, and the other didn't, although they both still had the struct properties from the loader correct. The one with the correct properties also happened to be the one unnoticed by GetComponentsInChildren<T>().\r\n\r\nThe code I used to come to these conclusions is in the ModularNoise and PQSMod_ ModularNoise classes in the ModularNoise.cs file, in the development branch of KopernicusExpansion. It includes the debug code. \r\n[Link to debug code](https://github.com/HappyFaceIndustries/KopernicusExpansion/blob/de52047832f640c2c9f5ea1bee751c833b90df3f/KopernicusExpansion/Configuration/ModularNoise.cs#L92)\r\n\r\nI loaded the same code into a Kopernius fork, and it doesn't seem to happen to stuff inside Kopernicus.dll\r\n\r\n\r\n**EDIT : Apparently, this issue only affects properties whose loaders are outside Kopernicus.dll. Texture2DLoaders and other non-struct loaders from Kopernicus.dll work fine, but my own NoiseLoader class doesn't.**\r\n\r\n**EDIT 2 :  It appears that structs have nothing to do with this, it's just external Parsers in external PQSMods that have the issue.**"},"comment":{"url":"https://api.github.com/repos/Kopernicus/Kopernicus/issues/comments/148922460","html_url":"https://github.com/Kopernicus/Kopernicus/issues/91#issuecomment-148922460","issue_url":"https://api.github.com/repos/Kopernicus/Kopernicus/issues/91","id":148922460,"user":{"login":"HappyFaceIndustries","id":7258677,"avatar_url":"https://avatars.githubusercontent.com/u/7258677?v=3","gravatar_id":"","url":"https://api.github.com/users/HappyFaceIndustries","html_url":"https://github.com/HappyFaceIndustries","followers_url":"https://api.github.com/users/HappyFaceIndustries/followers","following_url":"https://api.github.com/users/HappyFaceIndustries/following{/other_user}","gists_url":"https://api.github.com/users/HappyFaceIndustries/gists{/gist_id}","starred_url":"https://api.github.com/users/HappyFaceIndustries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HappyFaceIndustries/subscriptions","organizations_url":"https://api.github.com/users/HappyFaceIndustries/orgs","repos_url":"https://api.github.com/users/HappyFaceIndustries/repos","events_url":"https://api.github.com/users/HappyFaceIndustries/events{/privacy}","received_events_url":"https://api.github.com/users/HappyFaceIndustries/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T15:14:24Z","updated_at":"2015-10-17T15:14:24Z","body":"OK, that explains it... Should I just run DontDestroyOnLoad on my PQSMods?\r\n\r\nAnyways, the changes I made to the PQS system did make everything much cleaner, so I might tidy that up and submit it as a pull request.\r\n\r\nThanks!"}}