예제 #1
0
 void OnEnable()
 {
     script = (NavMeshObject)target;
     if (script.subMesh == null)
     {
         EnterEditMode();
     }
 }
예제 #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());
        }
예제 #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);
        }
예제 #4
0
 void OnEnable()
 {
     script = (NavMeshObject)target;
 }
예제 #5
0
 void OnEnable()
 {
     script = (NavMeshObject)target;
 }