예제 #1
0
    public void AssignBehavior(Interactor interactor)
    {
        var behaviorParams = new ActivatableParams {
            EnableTentativeFocus = IsTentativeFocusEnabled ? EyeXBoolean.True : EyeXBoolean.False
        };

        interactor.CreateActivatableBehavior(ref behaviorParams);
    }
        /// <summary>
        /// Assigns the activatable behavior to an interactor.
        /// </summary>
        /// <param name="interactor">The interactor.</param>
        public void AssignBehavior(Interactor interactor)
        {
            var parameters = new ActivatableParams {
                EnableTentativeFocus = new EyeXBoolean(IsTentativeFocusEnabled).integerValue
            };

            interactor.CreateActivatableBehavior(ref parameters);
        }
예제 #3
0
 /// <summary>
 /// Assigns the activatable behavior to an interactor.
 /// </summary>
 /// <param name="interactor">The interactor.</param>
 public void AssignBehavior(Interactor interactor)
 {
     var parameters = new ActivatableParams { EnableTentativeFocus = new EyeXBoolean(IsTentativeFocusEnabled).integerValue };
     interactor.CreateActivatableBehavior(ref parameters);
 }
 public void AssignBehavior(Interactor interactor)
 {
     var behaviorParams = new ActivatableParams { EnableTentativeFocus = IsTentativeFocusEnabled ? EyeXBoolean.True : EyeXBoolean.False };
     interactor.CreateActivatableBehavior(ref behaviorParams);
 }
예제 #5
0
    /// <summary>
    /// Adds the interactor to the given snapshot.
    /// </summary>
    /// <param name="snapshot">Interaction snapshot.</param>
    /// <param name="windowId">ID of the game window.</param>
    /// <param name="gameWindowPosition">Position of the game window in screen coordinates.</param>
    public void AddToSnapshot(InteractionSnapshot snapshot, string windowId, Vector2 gameWindowPosition)
    {
        var interactor = snapshot.CreateInteractor(_id, _parentId, windowId);

        var bounds = interactor.CreateBounds(InteractionBoundsType.Rectangular);
        bounds.SetRectangularData(Location.rect.x + gameWindowPosition.x, Location.rect.y + gameWindowPosition.y, Location.rect.width, Location.rect.height);

        interactor.Z = Location.relativeZ;

        if (Mask != null &&
            Mask.Type != EyeXMaskType.None)
        {
            interactor.CreateMask(MaskType.Default, Mask.Size, Mask.Size, Mask.MaskData);
        }

        if ((_behaviors & EyeXBehaviors.Activatable) != 0)
        {
            var behaviorParams = new ActivatableParams { EnableTentativeFocus = EyeXBoolean.False };
            interactor.SetActivatableBehavior(ref behaviorParams);
        }

        if ((_behaviors & EyeXBehaviors.ActivatableWithTentativeFocus) != 0)
        {
            var behaviorParams = new ActivatableParams { EnableTentativeFocus = EyeXBoolean.True };
            interactor.SetActivatableBehavior(ref behaviorParams);
        }

        if ((_behaviors & EyeXBehaviors.GazeAware) != 0)
        {
            interactor.CreateBehavior(InteractionBehaviorType.GazeAware);
        }

        if ((_behaviors & EyeXBehaviors.GazeAwareWithInertia) != 0)
        {
            var gazeAwareParams = new GazeAwareParams() { GazeAwareMode = GazeAwareMode.Delayed, DelayTime = 500 };
            interactor.SetGazeAwareBehavior(ref gazeAwareParams);
        }

        if (_behaviorCallback != null)
        {
            _behaviorCallback(_id, interactor);
        }
    }