Пример #1
0
        void ShowPanel(Vector3 position, Transform interactableTransform, CommandType possibleCommands)
        {
            commandPanel.transform.position = new Vector3(position.x, position.y, commandPanel.transform.position.z);

            if (!possibleCommands.HasFlag(CommandType.NONE))
            {
                foreach (CommandType commandType in GetFlags(possibleCommands))
                {
                    CommandButton button = commandButtons.AddCommand(commandType);
                    SetCommandAction(button, position, interactableTransform, commandType);
                }
                //
                // foreach (CommandType commandType in Enum.GetValues(typeof(CommandType)))
                // {
                //     if (commandType == CommandType.NONE)
                //         continue;
                //
                //     CommandButton button = commandButtons.AddCommand(commandType);
                //     SetCommandAction(button, position, interactableTransform, commandType);
                // }

                commandButtons.PositionChildren();
            }

            commandPanel.SetActive(true);
            commandInput.panelOpen = true;
            StartCoroutine(commandButtons.ShowButtons());
        }
Пример #2
0
 public static bool RequiresReply(this CommandType type)
 {
     return(type.HasFlag(CommandType.DirectNoReply));
 }