// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 using System.Collections.Generic; using UnityEditor; using UnityEngine; namespace AmazonGameLift.Editor { /// /// Provides an to draw a spinner UI animation. /// internal static class SpinnerDrawerFactory { private static IReadOnlyList s_sequence; public static ImageSequenceDrawer Create(float size) { if (s_sequence == null) { var imageLoader = new ImageLoader(); s_sequence = imageLoader.LoadImageSequence(AssetNames.SpinnerIcon, first: 1, last: 4); } return new GuiLayoutImageSequenceDrawer(size, size, s_sequence, framesPerSecond: 10f, () => EditorApplication.timeSinceStartup); } } }