This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using Unity.Behavior.GraphFramework; | |
using Unity.AppUI.UI; | |
using UnityEngine.UIElements; | |
namespace Unity.Behavior | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Take a set of actions and create an InputDevice for it that has a control | |
// for each of the actions. Also binds the actions to that those controls. | |
public static InputDevice SetUpMockInputForActions(InputActionAsset actions) | |
{ | |
var layoutName = actions.name; | |
// Build a device layout that simply has one control for each action in the asset. | |
InputSystem.RegisterLayoutBuilder(() => | |
{ | |
var builder = new InputControlLayout.Builder() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// This provides a library for stubbing and mocking C++ code as is. It works by requiring | |
// explicit hooks to be inserted into the code that is to be mocked. In a regular build, | |
// these hooks will do nothing. In a testing build, they will expand to calls into the | |
// framework here to allow the code being executed to be hijacked from outside. | |
// | |
// NOTE: Thread-safety! Arranging fakes must be done on a single thread. Using fakes can | |
// be done from multiple threads concurrently. | |
// |