3
0

BoolTrack.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <LyShine/Animation/IUiAnimation.h>
  10. #include "AnimTrack.h"
  11. //////////////////////////////////////////////////////////////////////////
  12. //////////////////////////////////////////////////////////////////////////
  13. /** Boolean track, every key on this track negates boolean value.
  14. */
  15. class UiBoolTrack
  16. : public TUiAnimTrack<IBoolKey>
  17. {
  18. public:
  19. AZ_CLASS_ALLOCATOR(UiBoolTrack, AZ::SystemAllocator)
  20. AZ_RTTI(UiBoolTrack, "{F0EDB82F-B3D7-47FC-AA97-91358A7F1168}", IUiAnimTrack);
  21. UiBoolTrack();
  22. virtual EUiAnimValue GetValueType() { return eUiAnimValue_Bool; };
  23. virtual void GetValue(float time, bool& value);
  24. virtual void SetValue(float time, const bool& value, bool bDefault = false);
  25. void SerializeKey([[maybe_unused]] IBoolKey& key, [[maybe_unused]] XmlNodeRef& keyNode, [[maybe_unused]] bool bLoading) {};
  26. void GetKeyInfo(int key, const char*& description, float& duration);
  27. void SetDefaultValue(const bool bDefaultValue);
  28. static void Reflect(AZ::SerializeContext* serializeContext);
  29. private:
  30. bool m_bDefaultValue;
  31. };