Example #1
0
    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;
            }
        }
    }
Example #3
0
    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;
            }
        }
    }
Example #4
0
    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;
            }
        }
    }