hey,
this is my error:
Error 1 Inconsistent accessibility: parameter type System.Collections.Generic.List<AdvancedWaypoint.Waypoint> is less accessible than method AdvancedWaypoint.SetWPList(System.Collections.Generic.List<AdvancedWaypoint.Waypoint>)
C:UsersAdvancedWaypoint.cs 30
i asked a friend, i used google but didn t found something cause i tried to set alll to public.
i am trying to make a list which stores all waypoint data i need. (i use unity-engine)
need diffrent classes cause there should be only one waypoint class =)
here first class:
<div style="color:Black; background-color:White
<pre><span style="color:Blue using UnityEngine;<br/>
using System.Collections;<br/>
using System.Collections.Generic;<br/>
<br/>
public class AdvancedWaypoint : MonoBehaviour<br/>
{<br/>
public GameObject advWpListScript;<br/>
public bool hideGizmos = false;<br/>
public float radiusWaypoint;<br/>
public GameObject[] alternateWayPs = new GameObject[6];<br/>
<br/>
private AdvancedWaypointList m_advWPList;<br/>
<br/>
class Waypoint<br/>
{<br/>
public string id;<br/>
public List<float> distanceToWPs;<br/>
public Vector3 position;<br/>
public List<Waypoint> alternateWPs; <br/>
};<br/>
<br/>
List<Waypoint> tmpWPList = new List<Waypoint>();<br/>
<br/>
public void SetWPList(List<Waypoint> list)<br/>
{<br/>
tmpWPList = list;<br/>
}<br/>
<br/>
// Use this for pre-initialization<br/>
void Awake()<br/>
{<br/>
m_advWPList = advWpListScript.GetComponent<AdvancedWaypointList>();<br/>
<br/>
radiusWaypoint = 4.0f;<br/>
hideGizmos = false;<br/>
name = GetInstanceID().ToString();<br/>
<br/>
tmpWPList = m_advWPList.SetWPList(tmpWPList);<br/>
}<br/>
[/code]
here second:
<div style="color:Black; background-color:White
<pre>using UnityEngine;<br/>
using System.Collections;<br/>
using System.Collections.Generic;<br/>
<br/>
public class AdvancedWaypointList : MonoBehaviour<br/>
{<br/>
class Waypoint<br/>
{<br/>
public string id;<br/>
public List<float> distanceToWPs;<br/>
public Vector3 position;<br/>
public List<Waypoint> alternateWPs;<br/>
};<br/>
<br/>
List<Waypoint> waypoints = new List<Waypoint>();<br/>
<br/>
Waypoint wp = new Waypoint();<br/>
Waypoint tmpAlternateWp = new Waypoint();<br/>
<br/>
// Use this for pre-initialization<br/>
void Awake()<br/>
{ <br/>
wp.alternateWPs = new List<Waypoint>();<br/>
}<br/>
<br/>
<br/>
public void AddToWPList(GameObject[] alternateWayPs, string currWp)<br/>
{<br/>
GameObject obj = GameObject.Find(currWp);<br/>
wp.id = obj.GetInstanceID().ToString();<br/>
wp.position = obj.transform.position;<br/>
<br/>
foreach (GameObject gameObj in alternateWayPs)<br/>
{<br/>
if (gameObj != null)<br/>
{<br/>
tmpAlternateWp.id = gameObj.GetInstanceID().ToString();<br/>
tmpAlternateWp.position = gameObj.transform.position;<br/>
wp.alternateWPs.Add(tmpAlternateWp);<br/>
}<br/>
}<br/>
<br/>
waypoints.Add(wp);<br/>
}<br/>
}<br/>
[/code]
i hope i said all important facts. i am greatful for any help or advice you may offer.
View the full article
this is my error:
Error 1 Inconsistent accessibility: parameter type System.Collections.Generic.List<AdvancedWaypoint.Waypoint> is less accessible than method AdvancedWaypoint.SetWPList(System.Collections.Generic.List<AdvancedWaypoint.Waypoint>)
C:UsersAdvancedWaypoint.cs 30
i asked a friend, i used google but didn t found something cause i tried to set alll to public.
i am trying to make a list which stores all waypoint data i need. (i use unity-engine)
need diffrent classes cause there should be only one waypoint class =)
here first class:
<div style="color:Black; background-color:White
<pre><span style="color:Blue using UnityEngine;<br/>
using System.Collections;<br/>
using System.Collections.Generic;<br/>
<br/>
public class AdvancedWaypoint : MonoBehaviour<br/>
{<br/>
public GameObject advWpListScript;<br/>
public bool hideGizmos = false;<br/>
public float radiusWaypoint;<br/>
public GameObject[] alternateWayPs = new GameObject[6];<br/>
<br/>
private AdvancedWaypointList m_advWPList;<br/>
<br/>
class Waypoint<br/>
{<br/>
public string id;<br/>
public List<float> distanceToWPs;<br/>
public Vector3 position;<br/>
public List<Waypoint> alternateWPs; <br/>
};<br/>
<br/>
List<Waypoint> tmpWPList = new List<Waypoint>();<br/>
<br/>
public void SetWPList(List<Waypoint> list)<br/>
{<br/>
tmpWPList = list;<br/>
}<br/>
<br/>
// Use this for pre-initialization<br/>
void Awake()<br/>
{<br/>
m_advWPList = advWpListScript.GetComponent<AdvancedWaypointList>();<br/>
<br/>
radiusWaypoint = 4.0f;<br/>
hideGizmos = false;<br/>
name = GetInstanceID().ToString();<br/>
<br/>
tmpWPList = m_advWPList.SetWPList(tmpWPList);<br/>
}<br/>
[/code]
here second:
<div style="color:Black; background-color:White
<pre>using UnityEngine;<br/>
using System.Collections;<br/>
using System.Collections.Generic;<br/>
<br/>
public class AdvancedWaypointList : MonoBehaviour<br/>
{<br/>
class Waypoint<br/>
{<br/>
public string id;<br/>
public List<float> distanceToWPs;<br/>
public Vector3 position;<br/>
public List<Waypoint> alternateWPs;<br/>
};<br/>
<br/>
List<Waypoint> waypoints = new List<Waypoint>();<br/>
<br/>
Waypoint wp = new Waypoint();<br/>
Waypoint tmpAlternateWp = new Waypoint();<br/>
<br/>
// Use this for pre-initialization<br/>
void Awake()<br/>
{ <br/>
wp.alternateWPs = new List<Waypoint>();<br/>
}<br/>
<br/>
<br/>
public void AddToWPList(GameObject[] alternateWayPs, string currWp)<br/>
{<br/>
GameObject obj = GameObject.Find(currWp);<br/>
wp.id = obj.GetInstanceID().ToString();<br/>
wp.position = obj.transform.position;<br/>
<br/>
foreach (GameObject gameObj in alternateWayPs)<br/>
{<br/>
if (gameObj != null)<br/>
{<br/>
tmpAlternateWp.id = gameObj.GetInstanceID().ToString();<br/>
tmpAlternateWp.position = gameObj.transform.position;<br/>
wp.alternateWPs.Add(tmpAlternateWp);<br/>
}<br/>
}<br/>
<br/>
waypoints.Add(wp);<br/>
}<br/>
}<br/>
[/code]
i hope i said all important facts. i am greatful for any help or advice you may offer.
View the full article