유니티 공식 홈페이지에 게재된 'Unity 5.0 Uprade Guide'의 일부를 번역한 내용입니다.

 (해당 블로그 글은 향후 업데이트될 수 있습니다.)




AI


- Navmesh 외형(contour)이 파티셔닝의 변경으로 인해 다르게 보일 수 있습니다. 좁은 복도/출입구 등 이러한 비슷한 형태일 경우, 연결성에 대한 차이를 만들어낼 수 있습니다. navmesh 빌드 시 복셀(voxel) 사이즈를 수정함으로써 이러한 문제를 해결하시기 바랍니다.


- 이제 NavMeshAgent의 목적지를 설정하는 행위 자체를 통해서는 ‘Stop’ 호출한 후의 에이전트를 재시작되지 않습니다. 따라서 에이전트를 재시작하려면 명시적으로 ‘Resume’을 호출하세요.

- NavMeshAgent.updatePosition: 이제 updatePosition이 fasle 상태에서 에이전트 트랜스폼을 이동했을 때, 에이전트 위치가 변경되지 않습니다. 예전에는 근처 navmesh로 제한된 위치로 리셋되었습니다.
 
- NavMeshObstacle 컴포넌트: 새롭게 만들어진 NavMeshObstacle 컴포넌트의 기본 모양은 박스(box)입니다. 어떤 모양이던지(박스 또는 캡슐) 이제 carving과 avoidance로 모두 적용됩니다.

- 이전 버전에서 빌드된 Navmesh는 지원되지 않으므로, 유니티 5로 리빌드해야 합니다. 아래의 스크립트는 프로젝트 내의 모든 씬들에 대해서 NavMesh 데이터를 리빌드하는 예제이므로 참고바랍니다.



Rebake script example


#if UNITY_EDITOR

using System.Collections.Generic;

using System.Collections;

using System.IO;

using UnityEditor;

using UnityEngine;

public class RebakeAllScenesEditorScript

{

    [MenuItem ("Upgrade helper/Bake All Scenes")]

    public static void Bake()

    {

        List<string> sceneNames = SearchFiles (Application.dataPath, "*.unity");

        foreach (string f in sceneNames)

        {

            EditorApplication.OpenScene(f);

 

            // Rebake navmesh data

            NavMeshBuilder.BuildNavMesh ();

 

            EditorApplication.SaveScene ();

        }

    }

    static List<string> SearchFiles(string dir, string pattern)

    {

        List <string> sceneNames = new List <string>();

        foreach (string f in Directory.GetFiles(dir, pattern, SearchOption.AllDirectories))

        {

            sceneNames.Add (f);

        }

        return sceneNames;

    }

}

#endif


글 내용과 관련하여 문의사항이 있으시면 댓글을 남겨주세요, 

감사합니다.



Posted by 흑 기사
,