<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Texture doesn't change the 3rd time ???]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1487</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1487&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Texture doesn't change the 3rd time ???.]]></description>
		<lastBuildDate>Thu, 09 Apr 2020 18:11:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6140#p6140</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 09 Apr 2020 18:11:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6140#p6140</guid>
		</item>
		<item>
			<title><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6139#p6139</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (grenouille)]]></author>
			<pubDate>Thu, 09 Apr 2020 14:35:05 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6139#p6139</guid>
		</item>
		<item>
			<title><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6138#p6138</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Wed, 08 Apr 2020 13:49:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6138#p6138</guid>
		</item>
		<item>
			<title><![CDATA[Re: Texture doesn't change the 3rd time ???]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6137#p6137</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 08 Apr 2020 09:09:16 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6137#p6137</guid>
		</item>
		<item>
			<title><![CDATA[Texture doesn't change the 3rd time ???]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6136#p6136</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Tue, 07 Apr 2020 18:25:53 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6136#p6136</guid>
		</item>
	</channel>
</rss>
