private void Update()
    {
        RaycastHit hit = player.GetRaycastHit();

        if (hit.collider != null && hit.collider.gameObject == gameObject)
        {
            rend.sharedMaterials = myMaterials;
        }
        else
        {
            rend.sharedMaterials = tempMaterials;
        }
    }
示例#2
0
    private void Update()
    {
        RaycastHit hit = player.GetRaycastHit();

        if (hit.collider != null && hit.collider.gameObject == gameObject)
        {
            EnableOutline();
        }
        else
        {
            DisableOutline();
        }
    }
示例#3
0
    // Update is called once per frame
    void Update()
    {
        RaycastHit hit = controller.GetRaycastHit();

        if (hit.collider != null && hit.collider.gameObject == gameObject)
        {
            EnableOutline();
        }
        else if (hit.collider != null && hit.collider.gameObject == other)
        {
            EnableOutline();
        }
        else
        {
            DisableOutline();
        }
    }
示例#4
0
    private void PlayLabSounds()
    {
        if (playerControl == null)
        {
            playerControl = FindObjectOfType <InteractionController>();
        }

        if (microscope == null)
        {
            microscope = FindObjectOfType <MicroscopeController>();
        }

        hitObject  = playerControl.GetRaycastHit().collider;
        heldObject = playerControl.HeldObject;

        if (wasHolding == false && heldObject != null && heldObject.CompareTag("Slide"))
        {
            wasHolding = true;
            audios[0].Play();
        }

        // Insert Slide into Microscope slide
        //if (Input.GetMouseButtonDown(0) && wasHolding && hitObject != null
        //    && hitObject.gameObject.name == "Slide Bed")
        //{
        //    audios[1].Play();
        //    wasHolding = false;

        //}

        if (!slideIn && microscope.GetSlideName() != "")
        {
            slideIn = true;
            audios[1].Play();
        }

        if (slideIn && microscope.GetSlideName() == "")
        {
            slideIn = false;
        }

        if (wasHolding && heldObject == null)
        {
            wasHolding = false;
        }
    }
示例#5
0
    private void ShowLabRoomTips()
    {
        if (tempPlayer == null)
        {
            tempPlayer = FindObjectOfType <InteractionController>();
        }


        if (instance.pcChecked == false && tempPlayer.GetRaycastHit().collider != null &&
            tempPlayer.GetRaycastHit().collider.name == "Monitor")
        {
            instance.pcChecked = true;
        }

        if (instance.micChecked == false && tempPlayer.GetRaycastHit().collider != null &&
            (tempPlayer.GetRaycastHit().collider.name == "Looking part" ||
             tempPlayer.GetRaycastHit().collider.name == "Looking part 1"))
        {
            instance.micChecked = true;
        }

        if (instance.slidesChecked == false && tempPlayer.GetRaycastHit().collider != null &&
            tempPlayer.GetRaycastHit().collider.CompareTag("Slide"))
        {
            instance.slidesChecked = true;
        }

        if (instance.anxiousPicked == false && tempPlayer.GetHeldObject() != null &&
            tempPlayer.GetHeldObject().name == "Anxious Mouse")
        {
            instance.anxiousPicked = true;
            Refresh(15);
        }

        if (instance.controlPicked == false && tempPlayer.GetHeldObject() != null &&
            tempPlayer.GetHeldObject().name == "Control Mouse")
        {
            instance.controlPicked = true;
            Refresh(13);
        }

        if (instance.allViewed == false && instance.pcChecked == true &&
            instance.micChecked == true && instance.slidesChecked == true)
        {
            instance.allViewed = true;
        }
    }
示例#6
0
    private void ShowLabRoomTips()
    {
        if (tempPlayer == null)
        {
            tempPlayer = FindObjectOfType <InteractionController>();
        }

        // Show computer tips
        if (instance.pcChecked == false && tempPlayer.GetRaycastHit().collider != null &&
            tempPlayer.GetRaycastHit().collider.name == "Monitor")
        {
            // Handle interrupt another tip
            //CloseRunningDisplay();
            instance.pcChecked      = true;
            instance.runningDisplay = StartCoroutine(DisplayTips(4, 5, 0.5f));
        }

        // show microscope tips
        if (instance.micChecked == false && tempPlayer.GetRaycastHit().collider != null &&
            (tempPlayer.GetRaycastHit().collider.name == "Looking part" ||
             tempPlayer.GetRaycastHit().collider.name == "Looking part 1"))
        {
            //CloseRunningDisplay();
            instance.micChecked     = true;
            instance.runningDisplay = StartCoroutine(DisplayTips(6, 8, 0.5f));
        }

        // show general slide tips
        if (instance.slidesChecked == false && tempPlayer.GetRaycastHit().collider != null &&
            tempPlayer.GetRaycastHit().collider.CompareTag("Slide"))
        {
            //CloseRunningDisplay();
            instance.slidesChecked  = true;
            instance.runningDisplay = StartCoroutine(DisplayTips(9, 10, 0.5f));
        }

        // Show slide pickup tips
        if (instance.anxiousPicked == false && tempPlayer.GetHeldObject() != null &&
            tempPlayer.GetHeldObject().name == "Anxious Mouse")
        {
            //CloseRunningDisplay();
            instance.anxiousPicked  = true;
            instance.runningDisplay = StartCoroutine(DisplayTip(11, 2f));
        }

        if (instance.controlPicked == false && tempPlayer.GetHeldObject() != null &&
            tempPlayer.GetHeldObject().name == "Control Mouse")
        {
            //CloseRunningDisplay();
            instance.controlPicked  = true;
            instance.runningDisplay = StartCoroutine(DisplayTip(12, 2f));
        }

        // Tip after you have looked at everything
        if (instance.allViewed == false && instance.pcChecked == true &&
            instance.micChecked == true && instance.slidesChecked == true)
        {
            //CloseRunningDisplay();
            instance.allViewed      = true;
            instance.runningDisplay = StartCoroutine(DisplayTips(13, 14, 0.5f, true));
        }
    }