public void Triggered(TriggerData td) { if (td.triggerType == TriggerType.Instant && td.pressed) { StartCoroutine(LerpToNewTransform()); } }
void Triggered(Interactable.TriggerData td) { if (td.pressed) { Instantiate(prefabToSpawn, transform.position, transform.rotation); } }
public void Triggered(TriggerData td) { if (td.pressed) { isActive = !isActive; } }
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); } }
void Triggered(Interactable.TriggerData td) { if (toggleVisibility && td.pressedAmount == 1) { isHidden = !isHidden; gameObject.SetActive(!isHidden); } else { isHidden = td.pressedAmount == 0; gameObject.SetActive(!isHidden); } }