protected override void OnTriggerExit(Collider other) { base.OnTriggerExit(other); LevelInteractive interactive = other.gameObject.GetComponent<LevelInteractive>(); if (interactive != null) { if (currentInteractive == interactive) { ToggleCurrentInteractive(false); isInteracting = false; currentInteractive = null; } } }
protected override void OnTriggerExit(Collider other) { base.OnTriggerExit(other); LevelInteractive interactive = other.gameObject.GetComponent <LevelInteractive>(); if (interactive != null) { if (currentInteractive == interactive) { ToggleCurrentInteractive(false); isInteracting = false; currentInteractive = null; } } }
protected override void OnTriggerEnter(Collider other) { base.OnTriggerEnter(other); LevelInteractive interactive = other.gameObject.GetComponent<LevelInteractive>(); if (interactive != null) { InteractiveTerminal terminal = interactive as InteractiveTerminal; InteractiveDoor door = interactive as InteractiveDoor; if (terminal != null || door != null && door.doorType == InteractiveDoor.DoorType.Exit && door.isReady) { isInteracting = true; currentInteractive = interactive; } } }
private void OnTriggerEnter(Collider other) { if (other.transform.parent != null) { Enemy enemy = other.transform.parent.GetComponent <Enemy>(); if (enemy != null) { GameRoot.current.enemiesOnCamera.Add(enemy); enemy.isEnabled = true; } } LevelInteractive interactive = other.gameObject.GetComponent <LevelInteractive>(); if (interactive != null) { GameRoot.current.interactivesOnCamera.Add(interactive); } }
protected override void OnTriggerEnter(Collider other) { base.OnTriggerEnter(other); LevelInteractive interactive = other.gameObject.GetComponent <LevelInteractive>(); if (interactive != null) { InteractiveTerminal terminal = interactive as InteractiveTerminal; InteractiveDoor door = interactive as InteractiveDoor; if (terminal != null || door != null && door.doorType == InteractiveDoor.DoorType.Exit && door.isReady) { isInteracting = true; currentInteractive = interactive; } } }