Deletes a given path.



参数 描述
index The index of the path to delete.

返回: N/A(无返回值)


You can use this code to remove a path from memory. If this path has been created dynamically using path_add, the variable that holds the path index will no longer be valid for accessing the path as it no longer exists, and if the path was created using the Path Editor that path can no longer be accessed in the whole game as you are permanently deleting it.

重要!该函数在试用版(Trial License)产品中可用。


var t_path;
t_path = path_add();
if mp_grid_path(grid, t_path, x, y, obj_Player.x, obj_Player.y, 1)
   path_assign(mypath, t_path);

The above code will create a path and store its index in a local variable. This path is then used to store an mp_grid_path generated path which, if it succeeds in finding its way to the target, it is then assigned to the path indexed in "mypath". Finally the "t_path" is deleted.

上一页: Changing Paths
下一页: path_duplicate
© Copyright YoYo Games Ltd. 2018 All Rights Reserved