CubismLookTargetBehaviour.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Copyright(c) Live2D Inc. All rights reserved.
  3. *
  4. * Use of this source code is governed by the Live2D Open Software license
  5. * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
  6. */
  7. using UnityEngine;
  8. namespace Live2D.Cubism.Framework.LookAt
  9. {
  10. /// <summary>
  11. /// Straight-forward <see cref="ICubismLookTarget"/> <see cref="MonoBehaviour"/>.
  12. /// </summary>
  13. public class CubismLookTargetBehaviour : MonoBehaviour, ICubismLookTarget
  14. {
  15. #region Implementation of ICubismLookTarget
  16. /// <summary>
  17. /// Gets the position of the target.
  18. /// </summary>
  19. /// <returns>The position of the target in world space.</returns>
  20. Vector3 ICubismLookTarget.GetPosition()
  21. {
  22. return transform.position;
  23. }
  24. /// <summary>
  25. /// Gets whether the target is active.
  26. /// </summary>
  27. /// <returns><see langword="true"/> if the target is active; <see langword="false"/> otherwise.</returns>
  28. bool ICubismLookTarget.IsActive()
  29. {
  30. return isActiveAndEnabled;
  31. }
  32. #endregion
  33. }
  34. }