Exemplo n.º 1
0
 public void Triggered(TriggerData td)
 {
     if (td.triggerType == TriggerType.Instant && td.pressed)
     {
         StartCoroutine(LerpToNewTransform());
     }
 }
Exemplo n.º 2
0
 void Triggered(Interactable.TriggerData td)
 {
     if (td.pressed)
     {
         Instantiate(prefabToSpawn, transform.position, transform.rotation);
     }
 }
Exemplo n.º 3
0
 public void Triggered(TriggerData td)
 {
     if (td.pressed)
     {
         isActive = !isActive;
     }
 }
Exemplo n.º 4
0
 void Triggered(Interactable.TriggerData td)
 {
     if (td.pressed)
     {
         td.triggerGameObject.transform.position = Vector3.MoveTowards(td.triggerGameObject.transform.position, risePoint, riseSpeed * Time.deltaTime);
     }
     else
     {
         td.triggerGameObject.transform.position = Vector3.MoveTowards(td.triggerGameObject.transform.position, initialPoint, riseSpeed * Time.deltaTime);
     }
 }
Exemplo n.º 5
0
 void Triggered(Interactable.TriggerData td)
 {
     if (toggleVisibility && td.pressedAmount == 1)
     {
         isHidden = !isHidden;
         gameObject.SetActive(!isHidden);
     }
     else
     {
         isHidden = td.pressedAmount == 0;
         gameObject.SetActive(!isHidden);
     }
 }