behavior3行为树
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

20 lignes
628 B

  1. %%%-------------------------------------------------------------------
  2. %%% @author DY
  3. %%% @copyright (C) 2020, <COMPANY>
  4. %%% @doc
  5. %%% 游戏结束,根据is_win属性打印结果
  6. %%% 打印结果,结束行为树运行
  7. %%% 返回:SUCCESS
  8. %%% @end
  9. %%% Created : 07. 10月 2020 15:13
  10. %%%-------------------------------------------------------------------
  11. -module(action_finish).
  12. -include("eBhv3.hrl").
  13. -include("example.hrl").
  14. %% API
  15. -export([tick/2]).
  16. tick(#{properties := #{is_win := IsWin}} = _BTree, #{uid := UID} = State) ->
  17. self() ! finish,
  18. ?INFO("游戏结束,~ts~ts!", [UID, IsWin]),
  19. {?BT_SUCCESS, State}.