コード例 #1
0
        public NavMeshInspector(PathFindingMachine machine) :
            base(machine)
        {
            string scenePath = GetCurrentScenePath();
            string sceneName = GetCurrentSceneName();

            saveFilePath = scenePath.Substring(0, scenePath.IndexOf(".unity")) + "/" + sceneName + "_nav.asset";

            // load previous settings
            var existingAsset = AssetDatabase.LoadAssetAtPath <NavMeshData>(saveFilePath);

            if (existingAsset != null)
            {
            }
        }
コード例 #2
0
        public Grid2DInspector(PathFindingMachine machine) :
            base(machine)
        {
            string scenePath = GetCurrentScenePath();
            string sceneName = GetCurrentSceneName();

            saveFilePath = scenePath.Substring(0, scenePath.IndexOf(".unity")) + "/" + sceneName + "_nav.asset";

            // load previous settings
            var existingAsset = AssetDatabase.LoadAssetAtPath <Grid2DNavData>(saveFilePath);

            if (existingAsset != null)
            {
                GridSize   = existingAsset.GridSize * 0.001f;
                RoleRadius = existingAsset.AgentRadius * 0.001f;
                MaxSlope   = existingAsset.MaxSlope;
            }

            if (builder.worldBoxObj == null)
            {
                builder.worldBoxObj = GameObject.Find("worldbox");
            }
        }
コード例 #3
0
 void OnEnable()
 {
     machine = target as PathFindingMachine;
     EnaureInspector();
 }
コード例 #4
0
 public EditorInspector(PathFindingMachine machine)
 {
     this.machine = machine;
 }
コード例 #5
0
 void Awake()
 {
     Instance = this;
 }