public override void SetupUsingApi(GameObject _interaction)
        {
            // Get the data and cast it
            string objectToGazeGUID = creationData[0].ToString();
            bool   gazeIn           = (bool)creationData[1];
            Gaze_GazeConstraints gazeConstraints = (Gaze_GazeConstraints)creationData[2];

            // Get the conditions obj
            Gaze_Conditions conditions = _interaction.GetComponent <Gaze_Conditions>();

            // Set al the necessary parameters
            conditions.gazeEnabled          = true;
            conditions.gazeIn               = gazeIn;
            constraints                     = gazeConstraints;
            conditions.gazeConstraintsIndex = (int)gazeConstraints;
            conditions.gazeStateIndex       = gazeIn ? (int)Gaze_HoverStates.IN : (int)Gaze_HoverStates.OUT;


            if (gazeConstraints == Gaze_GazeConstraints.OBJECT)
            {
                Gaze_InteractiveObject io = SpatialStoriesAPI.GetInteractiveObjectWithGUID(objectToGazeGUID);
                conditions.gazeColliderIO = io;
                // Setup the gaze collider
                Setup(io.GetComponentInChildren <Gaze_Gaze>().GetComponent <Collider>());
            }
            else
            {
                // Setup the gaze collider
                conditions.gazeColliderIO = conditions.RootIO;
                Setup(conditions.RootIO.GetComponentInChildren <Gaze_Gaze>().GetComponent <Collider>());
            }
        }
 public void FireGazeEvent(object _sender, bool _isGazed, Gaze_GazeConstraints _constraints)
 {
     // notify every listener with the new current gazed object
     gaze_gazeEventArgs.Sender     = _sender;
     gaze_gazeEventArgs.IsGazed    = _isGazed;
     gaze_gazeEventArgs.TargetType = _constraints;
     Gaze_EventManager.FireGazeEvent(gaze_gazeEventArgs);
 }
        public static Gaze_GazeCondition CreateGazeCondition(this S_InteractionDefinition _def,
                                                             string _objectToGazeGUID, Gaze_HoverStates _hoveState, Gaze_GazeConstraints _constraints)
        {
            bool gazeIn = _hoveState == Gaze_HoverStates.IN;

            return(_def.CreateCondition <Gaze_GazeCondition>(_objectToGazeGUID, gazeIn, _constraints));
        }
 public Gaze_GazeCondition(Gaze_Conditions _gazeConditionsScript, Collider _gazeCollider, Gaze_GazeConstraints _constraints) : base(_gazeConditionsScript)
 {
     constraints = _constraints;
     Setup(_gazeCollider);
 }
示例#5
0
 /// <summary>
 /// Arguments for animation events related.
 /// </summary>
 /// <param name="_sender">Is the sender's object.</param>
 public Gaze_GazeEventArgs(object _sender, bool _isGazed, Gaze_GazeConstraints _targetType)
 {
     sender     = _sender;
     isGazed    = _isGazed;
     TargetType = _targetType;
 }