public static FocusFilterStorage GetFocusTouch(AiBehaviourController controller)
    {
        const float timeSortScale     = 1.0f;
        const float distanceSortScale = 1.0f;

        const string storageName = "touchStorage";
        const string focusName   = "touchFocus";

        StimuliStorage storage = controller.GetBlackboardValue <StimuliStorage>(storageName)?.value;

        if (storage == null)
        {
            return(null);
        }

        GenericBlackboard.InitializeMethod <FocusFilterStorage> initializeMethod =
            () => new FocusFilterStorage(controller.transform, storage, distanceSortScale, timeSortScale);
        return(controller.InitBlackboardValue(focusName, initializeMethod).value);
    }
Esempio n. 2
0
 public BoxValue <T> InitBlackboardValue <T>(string key, GenericBlackboard.InitializeMethod <T> initializeMethod)
 {
     return(_blackboard.InitValue <T>(key, initializeMethod));
 }