<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — ChangeLocation]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1380&amp;type=atom" />
	<updated>2019-10-16T11:30:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1380</id>
		<entry>
			<title type="html"><![CDATA[Re: ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5700#p5700" />
			<content type="html"><![CDATA[<p>Thanks a lot I&#039;ll try it </p>]]></content>
			<author>
				<name><![CDATA[tamim.ali.zoabi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1098</uri>
			</author>
			<updated>2019-10-16T11:30:14Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5700#p5700</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5699#p5699" />
			<content type="html"><![CDATA[<p>No, you need to invoke the map redraw (OnlineMaps.instance.Redraw).</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-16T09:45:19Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5699#p5699</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5698#p5698" />
			<content type="html"><![CDATA[<p>Ok ..<br />The code is little more complex ... Forgote the code .. let me ask you with another more simple way .<br />I have created a Marker and it shown on my screen .<br />My Quistion : for changing the position of the marker .I need just to type : marker.positiin=new vector2(32.0000,35.000);<br />my Quistion is this line enough to change the marker position ?</p>]]></content>
			<author>
				<name><![CDATA[tamim.ali.zoabi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1098</uri>
			</author>
			<updated>2019-10-16T09:42:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5698#p5698</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5697#p5697" />
			<content type="html"><![CDATA[<p>First_Connection.MC.PI.Player_Is_Master<br />This line checks that the current player is a master, right?<br />In this case, why does SendMyLoacationToMaster check that the current player is not a master?<br />Most likely it should be checked that the current player is a master.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-16T09:23:23Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5697#p5697</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5695#p5695" />
			<content type="html"><![CDATA[<p>Hi<br />i need to know if that enough to ReDraw the new marker position ? it doesnt redraw the marker with the new position .. if this device is in a moiving car it should show the marker moving on the master screen after sending this RPC Function ?!!</p><p>private void OnLocationChanged(Vector2 position)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; MPV = Add_Room.go_to_Player_room.GetComponent&lt;PhotonView&gt;();<br />&nbsp; &nbsp; &nbsp; &nbsp; // Change the position of the marker.<br />&nbsp; &nbsp; &nbsp; &nbsp; playerMarker.position = position;<br />&nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Marker[0].marker.position = position;<br />&nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Marker[0].Latitude = position.y;<br />&nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Marker[0].Longtude = position.x;<br />&nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Marker[0].position = position;<br />&nbsp; &nbsp; &nbsp; &nbsp; //First_Connection.GClass.The_Marker[0].marker.position = position;<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.Redraw();<br />&nbsp; &nbsp; &nbsp; &nbsp; if (First_Connection.MC.PI.Player_Is_Master == false)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MPV.RPC(&quot;SendMyLoacationToMaster&quot;, RpcTarget.MasterClient, position, Load_Rooms.Player_Name);</p><p>and the RPC function is :<br /> [PunRPC]<br />&nbsp; &nbsp; private void SendMyLoacationToMaster(Vector2 Position,string name)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; int found = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; if (First_Connection.MC.PI.Player_Is_Master == false)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; First_Connection.GClass.The_Driver.Count; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (First_Connection.GClass.The_Driver[i ].Driver_Name == name)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Driver[i ].position = Position;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Driver[i ].marker.position = Position;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;Send My Locateion To Master : &quot; + First_Connection.GClass.The_Driver[i ].Driver_Name);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; found = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //return;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (found == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Driver driver = new Driver();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Texture2D txtr;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txtr = Resources.Load(&quot;c620c6b7a2b0e22a05e179ed8e7ab6b0_icon&quot;) as Texture2D;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // txtr = Resources.Load(&quot;Taxi&quot;) as Texture2D;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //OnlineMapsLocationService locationService = OnlineMapsLocationService.instance;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Create a new marker.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.marker = OnlineMapsMarkerManager.CreateItem(Position, txtr, name);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //playerMarker.align = OnlineMapsAlign.Center;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.latitude = Position.y;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.longtude = Position.x;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.position = Position;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.Driver_Found_And_Updated = false;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.Driver_Not_Found_Counter = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //driver.marker = playerMarker;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.Time_Enter_Room = System.DateTime.Now;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.Time_He_Push_Free = System.DateTime.Now;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;Marker Created Successfully......&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; driver.Driver_Name = name;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; First_Connection.GClass.The_Driver.Add(driver);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.Redraw();<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p>]]></content>
			<author>
				<name><![CDATA[tamim.ali.zoabi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1098</uri>
			</author>
			<updated>2019-10-15T15:02:21Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5695#p5695</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5694#p5694" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Based on your description, it&#039;s hard to say what&#039;s wrong.<br />Please show the full script.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-14T12:45:25Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5694#p5694</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[ChangeLocation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5692#p5692" />
			<content type="html"><![CDATA[<p>Hi<br />I am using Pun2 there is a master that can see every player position on his screen .<br />when some one moved his device location i need to notice the master about his new location .<br />so i add an event OnLocationChanged for every player and in that event function i added a RPC function that send the new location to the master . <br />but new locations doesn&#039;t shown.or Updated . <br />do i need to use (OnlineMaps.instance.Redraw();) &quot;i used it <br />what i supposed to do ?</p>]]></content>
			<author>
				<name><![CDATA[tamim.ali.zoabi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1098</uri>
			</author>
			<updated>2019-10-13T18:51:03Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5692#p5692</id>
		</entry>
</feed>
