<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Generating a Tour at runtime]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1691&amp;type=atom" />
	<updated>2021-02-05T18:43:49Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1691</id>
		<entry>
			<title type="html"><![CDATA[Re: Generating a Tour at runtime]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7140#p7140" />
			<content type="html"><![CDATA[<p>Now I see the problem.<br />Thanks for showing me this.</p><p>To fix this, modify Pano.cameraType property:<br /></p><div class="codebox"><pre><code>public CameraType cameraType
{
    get { return _cameraType; }
    set
    {
        if (_cameraType == value) return;
        
        if (_camera != null)
        {
            if (_cameraType == CameraType.createNew) Destroy(_camera.gameObject);
            _camera = null;
        }

        _cameraType = value;
    }
}</code></pre></div><p>The next version of uPano will contain this fix.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-02-05T18:43:49Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7140#p7140</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Generating a Tour at runtime]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7139#p7139" />
			<content type="html"><![CDATA[<p>Was the cameraType/existingCamera being properly maintained in the scene? With this method it returns back to createNew.</p>]]></content>
			<author>
				<name><![CDATA[bpfarrell]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1535</uri>
			</author>
			<updated>2021-02-05T16:57:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7139#p7139</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Generating a Tour at runtime]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7138#p7138" />
			<content type="html"><![CDATA[<p>Hello.</p><p>I just tested dynamic tour creation and it works correctly on my side.<br />Here&#039;s a video about it:<br /><a href="https://www.dropbox.com/s/r2si52bkbp7xcuc/uPano%20-%20Dynamic%20Tour.mp4?dl=0">https://www.dropbox.com/s/r2si52bkbp7xc … r.mp4?dl=0</a></p><p>If you have any exceptions on uPano side, please show the code that causes the exception. <br />I will check and fix all the problems on our side, or explain what is wrong on your side.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-02-05T10:48:03Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7138#p7138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Generating a Tour at runtime]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7136#p7136" />
			<content type="html"><![CDATA[<p>I am working on trying to generate a Tour dynamically at run time. The system I have built out works great if I generate the Tour items in editor, but there seems to be a referencing issue otherwise. Couple problems I am having, and have avoided a bit is making sure the uPano Tour Object, and at least one Tour Item is appended into it, otherwise there is several null references. I am generating the panos with this following code, and the cameraType/existingCamera do not get properly set in the scene graph, and default to &quot;createNew&quot;.<br /></p><div class="codebox"><pre><code>void MyPanoGenerator(Tour tour){
    TourItem item = TourItem.Create(tour);
    Pano pano = item.gameObject.GetComponent&lt;Pano&gt;();
    pano.cameraType = Pano.CameraType.existing;
    pano.existingCamera = Camera.main;
    SphericalPanoRenderer spr = item.gameObject.GetComponent&lt;SphericalPanoRenderer&gt;();
    spr.radius = 100;
    //....etc
}</code></pre></div><p>This does work fully IF this method is run in editor (before hitting the play button). Is there a method I need to use to update the pano with the new context, or another construction method I should use? </p><p>Thank you for you help</p>]]></content>
			<author>
				<name><![CDATA[bpfarrell]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1535</uri>
			</author>
			<updated>2021-02-04T22:01:44Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7136#p7136</id>
		</entry>
</feed>
