Exemple #1
0
 private void OnTriggerEvent(Gaze_TriggerEventArgs e)
 {
     if (e.Sender != null)
     {
         // if I'm not the gazed object
         if (!((GameObject)e.Sender).Equals(gameObject) && e.IsTrigger)
         {
             if (dependent)
             {
                 // check if the sender is one of my dependencies
                 ValidateDependencies((GameObject)e.Sender, -1);
             }
         }
     }
 }
Exemple #2
0
        private void onTriggerEvent(Gaze_TriggerEventArgs e)
        {
            // if sender is the this Behaviour gameObject
            if ((GameObject)e.Sender == gameObject)
            {
                if (e.IsTrigger)
                {
                    // execute trigger
                    TriggerCount      = e.Count;
                    TimeLastTriggered = e.Time;

                    //check if the action should be delayed
                    if (isDelayed)
                    {
                        HandleActionsInTime(() => OnTrigger(), TriggerEventsAndStates.OnTrigger);
                    }
                    else
                    {
                        OnTrigger();
                    }
                }
                else if (e.IsReload)
                {
                    // execute reload
                    ReloadCount      = e.Count;
                    TimeLastReloaded = e.Time;

                    //check if the action should be delayed
                    if (isDelayed)
                    {
                        HandleActionsInTime(() => OnReload(), TriggerEventsAndStates.OnReload);
                    }
                    else
                    {
                        OnReload();
                    }
                }
                else
                {
                    // initialize trigger
                    autoTriggerMode      = e.AutoTriggerMode;
                    ReloadMode           = e.ReloadMode;
                    ReloadMaxRepetitions = e.ReloadMaxRepetitions;
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Method called when a trigger events occur.
 /// </summary>
 /// <param name="e">event arguments</param>
 protected abstract void onTriggerEvent(Gaze_TriggerEventArgs e);