TeleportMarkerBase.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //======= Copyright (c) Valve Corporation, All rights reserved. ===============
  2. //
  3. // Purpose: Base class for all the objects that the player can teleport to
  4. //
  5. //=============================================================================
  6. using UnityEngine;
  7. namespace Valve.VR.InteractionSystem
  8. {
  9. //-------------------------------------------------------------------------
  10. public abstract class TeleportMarkerBase : MonoBehaviour
  11. {
  12. public bool locked = false;
  13. public bool markerActive = true;
  14. //-------------------------------------------------
  15. public virtual bool showReticle
  16. {
  17. get
  18. {
  19. return true;
  20. }
  21. }
  22. //-------------------------------------------------
  23. public void SetLocked( bool locked )
  24. {
  25. this.locked = locked;
  26. UpdateVisuals();
  27. }
  28. //-------------------------------------------------
  29. public virtual void TeleportPlayer( Vector3 pointedAtPosition )
  30. {
  31. }
  32. //-------------------------------------------------
  33. public abstract void UpdateVisuals();
  34. //-------------------------------------------------
  35. public abstract void Highlight( bool highlight );
  36. //-------------------------------------------------
  37. public abstract void SetAlpha( float tintAlpha, float alphaPercent );
  38. //-------------------------------------------------
  39. public abstract bool ShouldActivate( Vector3 playerPosition );
  40. //-------------------------------------------------
  41. public abstract bool ShouldMovePlayer();
  42. }
  43. }