<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Problem with LinkedObserver]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2369&amp;type=atom" />
	<updated>2025-06-03T08:30:28Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2369</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem with LinkedObserver]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9829#p9829" />
			<content type="html"><![CDATA[<p>Thanks, I&#039;ll message you on Discord</p>]]></content>
			<author>
				<name><![CDATA[ffeniks]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=21245</uri>
			</author>
			<updated>2025-06-03T08:30:28Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9829#p9829</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with LinkedObserver]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9828#p9828" />
			<content type="html"><![CDATA[<p>Hi.</p><p>Unity should not call the constructor. <br />The constructor is for you (users) so you can dynamically create LinkedObserver&#039;s.</p><p>_isObserverInitialized should not be serialized or cached because it is private and marked using NonSerialized attribute.</p><p>From your description I think the problem is in cross scene references.<br />In short: project elements can only reference other project elements. Scene elements can refer to elements of the current scene or project.<br />But a project element cannot refer to a scene, and an element in scene A cannot refer to an element in scene B.<br />Unity does not support this.</p><p>If the problem remains please send me your project, I will check it.<br />P.S. I don&#039;t need your working project. Any temporary project that shows the problem is enough for testing.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2025-06-02T15:16:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9828#p9828</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem with LinkedObserver]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9827#p9827" />
			<content type="html"><![CDATA[<p>Hey, I have a problem with LinkedObserver:</p><p>I have Source Prefab class with some ValueObserver called &quot;value&quot; and Watcher Prefab class with LinkedObserver called &quot;_state&quot;</p><p>Then, in Unity Editor I set _state linked observer to watch SourcePrefab.value</p><p>In WatcherPrefab I do:</p><p>&nbsp; &nbsp; private void Start() {<br />&nbsp; &nbsp; &nbsp; _state.AddListener(onStateChange);<br />&nbsp; &nbsp; }</p><p>It doesn&#039;t work as Unity somehow does not call LinkedObserver&#039;s constructor, caches _isObserverInitialized as &quot;true&quot; (I checked with debugger) and _state.Observer remains null, despite it being set in the editor.</p><p>I use Unity 6</p>]]></content>
			<author>
				<name><![CDATA[ffeniks]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=21245</uri>
			</author>
			<updated>2025-06-02T10:27:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9827#p9827</id>
		</entry>
</feed>
