private void OnTriggerExit(Collider other) { var player = other.gameObject.GetComponent <CharacterController>(); if (player != null) { ModificationSystem.MakeChange(parent, changeType); } }
private void Update() { SightZone sightZone = GlobalState.get().sightZone; bool inSightZone = sightZone.GetComponent <Collider>().bounds.Intersects(GetComponent <Collider>().bounds); if (holder.held == null && inSightZone && !gameObject.GetComponent <Renderer>().isVisible) { ModificationSystem.MakeChange(this, sightZone.changeType); } }
public override void OnInteract() { bool inFacesZone = GlobalState.get().facesZone.GetComponent <Collider>().bounds.Intersects(parent.GetComponent <Collider>().bounds); if (parent.holder.held == null && inFacesZone) { ModificationSystem.MakeChange(parent, changeType); } parent.OnFace(); }
private void Update() { foreach (var box in countdowns.Keys.ToList()) { var state = countdowns[box]; if (!state.changing) { countdowns.Remove(box); continue; } state.countdown -= Time.deltaTime; if (state.countdown <= 0) { countdowns.Remove(box); ModificationSystem.MakeChange(box, changeType); } } }
public void OnTriggerExit(Collider other) { Triggerable triggerable = other.GetComponent <Triggerable>(); if (triggerable == null || countdown > 0) { return; } if (Input.GetKey(KeyCode.W)) { countdown = cooldownSeconds; ModificationSystem.MakeChange(triggerable, forwardChange); } else if (Input.GetKey(KeyCode.S)) { countdown = cooldownSeconds; ModificationSystem.MakeChange(triggerable, backwardChange); } }