<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Texture doesn't change the 3rd time ???]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1487&amp;type=atom" />
	<updated>2020-04-09T18:11:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1487</id>
		<entry>
			<title type="html"><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6140#p6140" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Philzmz sent me a project, and I already found and fixed this bug.<br />Yes, the problem is hasMesh.</p><p>How to fix it:<br />Move this line from OnEnable to OnDestroy.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-04-09T18:11:14Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6140#p6140</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6139#p6139" />
			<content type="html"><![CDATA[<p>Hello,</p><p>I have a very similar problem.<br />I use the CubeFacesPanoRenderer and I change the renderer&#039;s textures at runtime using :<br /></p><div class="codebox"><pre><code>CubeFacesPanoRenderer.SetSide(int index, Texture2D texture)</code></pre></div><p>But if I try to change it 3 times the textures won&#039;t change anymore.</p><p>I did a bit of research in the code and it seems the problem comes from the <strong>hasMesh</strong> field in <strong>PanoRenderer</strong>.<br />The field is reset to false in OnEnable() but is never set to true after that.<br />To hide and show the panorama I activate or deactivate the Panorama gameobject.</p><p>It&#039;s worth mentioning that if I try to use the <strong>CreateMesh()</strong> or <strong>UpdateMesh()</strong> function it causes an infinite loop.</p><br /><p>EDIT : <br />If I comment line 265 in file PanoRenderer.cs the problem disappears :<br /></p><div class="codebox"><pre><code>protected void OnEnable()
{
    _pano = GetComponent&lt;Pano&gt;();
    hasMesh = false; // Line 265
}</code></pre></div><p>But I&#039;m not sure this is a correct solution.</p>]]></content>
			<author>
				<name><![CDATA[grenouille]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1264</uri>
			</author>
			<updated>2020-04-09T14:35:05Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6139#p6139</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6138#p6138" />
			<content type="html"><![CDATA[<p>Hello Alex</p><p>Thanks for your (as usual) quick answer for my issue about UPano.</p><p>To check if the problem was on my side, I built a new very light project from scratch with very simple actions, to see if I could reproduce the issue. So I confirm, I am afraid this is a UPano issue, as my &quot;code&quot; is pretty simple = get material texture / set Pano texture.</p><p>I made another vidéo to show the (same) issue in this new project: <a href="https://www.youtube.com/watch?v=_kwQyshva5M">https://www.youtube.com/watch?v=_kwQyshva5M</a><br />I sent you a link to download the project on your email as it contains UPano and PlayMaker Assets.</p><p>Best regards.</p>]]></content>
			<author>
				<name><![CDATA[philzmz]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=606</uri>
			</author>
			<updated>2020-04-08T13:49:47Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6138#p6138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6137#p6137" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Most likely, the problem is somewhere on your side, and most likely at some point you are creating a second panorama.<br />In your video (time 1:40), you can see that when you open the panorama, the slider in the hierarchy changes.<br />But, unfortunately, I have not seen your visual scripts, and I can’t say for sure what and where you are doing wrong.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-04-08T09:09:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6137#p6137</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Texture doesn't change the 3rd time ???]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6136#p6136" />
			<content type="html"><![CDATA[<p>Hello,</p><p>I have an issue that I can&#039;t solve with UPano, as it is not easy to explain I made a short video on this link : <a href="https://youtu.be/3XzHGLhwH7o">https://youtu.be/3XzHGLhwH7o</a></p><p>To resume : when a sphere is clicked, a PM script puts its name into a global variable, then it activates a panorama, gets the texture from a database and set the texture to the panorama. This works fine twice, then the texture displayed in the panorama doesn&#039;t change anymore although it is changed in the inspector.</p><p>If not clear, don&#039;t hesitate to ask.</p><p>Best regards,</p><p>Philippe</p>]]></content>
			<author>
				<name><![CDATA[philzmz]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=606</uri>
			</author>
			<updated>2020-04-07T18:25:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6136#p6136</id>
		</entry>
</feed>
