Exemplo n.º 1
0
 private void Update()
 {
     //IL_0013: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
     if (LocalOnly)
     {
         BroadcastType = VRC_EventHandler.VrcBroadcastType.Local;
     }
     if (Input.GetKeyDown(Key) && DownEventName != string.Empty && Handler.Events.FirstOrDefault((VRC_EventHandler.VrcEvent e) => e.Name == DownEventName) != null)
     {
         foreach (VRC_EventHandler.VrcEvent item in from e in Handler.Events
                  where e.Name == DownEventName
                  select e)
         {
             Handler.TriggerEvent(item, BroadcastType, Networking.LocalPlayer.get_gameObject());
         }
     }
     if (Input.GetKeyUp(Key) && UpEventName != string.Empty && Handler.Events.FirstOrDefault((VRC_EventHandler.VrcEvent e) => e.Name == UpEventName) != null)
     {
         foreach (VRC_EventHandler.VrcEvent item2 in from e in Handler.Events
                  where e.Name == UpEventName
                  select e)
         {
             Handler.TriggerEvent(item2, BroadcastType, Networking.LocalPlayer.get_gameObject());
         }
     }
 }
Exemplo n.º 2
0
        public override void Interact()
        {
            VRC_EventHandler vRC_EventHandler = this.GetComponent <VRC_EventHandler>();

            if (vRC_EventHandler == null)
            {
                vRC_EventHandler = this.GetComponentInParent <VRC_EventHandler>();
            }
            if (vRC_EventHandler != null)
            {
                vRC_EventHandler.TriggerEvent(EventName, BroadcastType, Networking.LocalPlayer.get_gameObject());
            }
        }
Exemplo n.º 3
0
 public void ApplyDamage(float damage)
 {
     if (currentHealth > 0f)
     {
         currentHealth -= damage;
         if (currentHealth <= 0f)
         {
             currentHealth = 0f;
         }
         if (!string.IsNullOrEmpty(damageEvent) && eventHandler != null)
         {
             foreach (VRC_EventHandler.VrcEvent item in from e in eventHandler.Events
                      where e.Name == damageEvent
                      select e)
             {
                 eventHandler.TriggerEvent(item, VRC_EventHandler.VrcBroadcastType.AlwaysUnbuffered);
             }
         }
         HandleCallbackTrigger(onDamagedTrigger, onDamagedEvent);
         HandleCallbackTrigger(spawnerOnDamagedTrigger, spawnerOnDamagedEvent);
         if (currentHealth == 0f)
         {
             if (!string.IsNullOrEmpty(destroyEvent) && eventHandler != null)
             {
                 foreach (VRC_EventHandler.VrcEvent item2 in from e in eventHandler.Events
                          where e.Name == destroyEvent
                          select e)
                 {
                     eventHandler.TriggerEvent(item2, VRC_EventHandler.VrcBroadcastType.AlwaysUnbuffered);
                 }
             }
             HandleCallbackTrigger(onDestructedTrigger, onDestructedEvent);
             HandleCallbackTrigger(spawnerOnDestructedTrigger, spawnerOnDestructedEvent);
         }
     }
 }
Exemplo n.º 4
0
 private void Update()
 {
     Timer += Time.get_deltaTime();
     if (Timer > Duration && !EventFired && Handler != null)
     {
         Handler.TriggerEvent(EventName, BroadcastType);
         if (Repeat)
         {
             ResetClock();
         }
         else
         {
             EventFired = true;
         }
     }
 }