Exemplo n.º 1
0
 void OnEnable()
 {
     script = (NavMeshObject)target;
     if (script.subMesh == null)
     {
         EnterEditMode();
     }
 }
Exemplo n.º 2
0
        private Vector3[] ConvertAllPoints(NavMeshObject script)
        {
            int            count = script.list.Count;
            List <Vector3> all   = new List <Vector3>();

            for (int i = 0; i < count; i++)
            {
                all.Add(script.transform.TransformPoint(script.list[i]));
            }

            return(all.ToArray());
        }
Exemplo n.º 3
0
        private bool CheckCombine(NavMeshObject script)
        {
            //get count of all submeshes
            int subPointsCount = script.subPoints.Count;

            if (subPointsCount > 0)
            {
                //remove submesh without references
                if (script.subPoints[subPointsCount - 1].list.Count == 0)
                {
                    script.subPoints.RemoveAt(subPointsCount - 1);
                }
                else if (script.subPoints[subPointsCount - 1].list.Count <= 2)
                {
                    NavMeshManagerEditor.ShowNotification("Can't combine submeshes.\nYou haven't placed enough points.");
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 4
0
 void OnEnable()
 {
     script = (NavMeshObject)target;
 }
Exemplo n.º 5
0
 void OnEnable()
 {
     script = (NavMeshObject)target;
 }