control_lock_color.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* control_lock_color.cs
  2. * author: Yannic Seidler
  3. * modified: Jingyi
  4. */
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using UnityEngine;
  8. // Class that outlines the robot if the robot is locked.
  9. // Attached to robot prefabs (in folders Telemax, Asterix) that get instantiated in the simulation scene.
  10. public class control_lock_color : MonoBehaviour
  11. {
  12. VRInput vrInput;
  13. Outline outLiner;
  14. // Start is called before the first frame update
  15. void Start()
  16. {
  17. outLiner = GetComponent<Outline>();
  18. }
  19. // Update is called once per frame
  20. // Enables the Outline.cs script which is also attached to the robot prefabs if the robot is locked.
  21. void Update()
  22. {
  23. if (InteractionManagement.Instance != null)
  24. {
  25. if(InteractionManagement.Instance.Robot_Locked == true)
  26. {
  27. outLiner.enabled = true;
  28. }
  29. else
  30. {
  31. outLiner.enabled = false;
  32. }
  33. }
  34. }
  35. }